Skip to contents

Draws the GitHub Actions runs of the repositories of a user, from what collect_stats() collects: how many ran, how many succeeded and failed, how long they took and which workflows ran most, in the last days days, as a card for a GitHub profile, a PNG or an SVG file, in a dark or a light mode.

Usage

plot_actions_card(
  stats = "rghcard-data",
  file = "rghcard-actions.png",
  theme = c("dark", "light"),
  days = 30,
  panels = NULL,
  title = NULL,
  width = 900
)

Arguments

stats

The statistics: what collect_stats() or read_stats() return, or the folder of the history.

file

The card: a .png or an .svg file. NULL returns the SVG code instead.

theme

"dark" or "light": the colors of GitHub's dark or light mode.

days

Count the runs of the last days days, up to the last full day collected: the day before the collection.

panels

One to three charts: "actions", "top_workflows", "run_time" and "top_failed", or those of the other cards. By default c("actions", "top_workflows", "run_time").

title

The title, by default the user name.

width

Width of the card in pixels. A PNG has twice as many, to stay sharp on high-resolution screens.

Value

The file, invisibly, or the SVG code when file is NULL.

Details

The key figures are the runs, the share of the finished runs that succeeded, the runs that failed, the time the runs took and the workflows that ran. A run takes the time from its start to its end, as a clock measures it: not the minutes that GitHub bills, which add up the jobs of a run that run side by side, and are free in public repositories. Runs collected before rghcard 0.4.0 have no times. By default the charts are:

  • "actions": the runs of each day, as columns, as on plot_stats_card().

  • "top_workflows": the five workflows with the most runs, those of the same name in several repositories together.

  • "run_time": the five repositories whose runs took the longest.

"top_failed", the five workflows with the most failed runs, can take the place of one.

See also

view_card() shows the card in the Viewer or the Plots pane, plot_stats_card() counts the runs among the other statistics, and use_rghcard_action() refreshes the cards on your profile.

Examples

card <- plot_actions_card(get_example_stats(), tempfile(fileext = ".svg"))
view_card(card, "plots")

plot_actions_card(get_example_stats(), tempfile(fileext = ".png"), theme = "light", days = 14,
                  panels = c("actions", "top_failed", "run_time"))