Fetches the most recent failed GitHub Actions run of the branch checked out in the working directory, downloads the log of each failed job and turns it into one row per finding.
Value
A data frame with one row per finding and the columns
job: job name, such as"ubuntu-latest (release)".os: runner label, such as"ubuntu-latest".step: name of the step the job failed in (NAwhen GitHub names none).kind: one of the kinds above.file: path relative to the package root, orNA.line: integer line infile, orNA.message: full text of the finding.sha: commit the run checked;fileandlinerefer to it.url: link to the job on GitHub.
Zero rows when the branch has no failed run. Printing shows one line per
finding; the full text stays in message.
Details
The repository comes from the origin remote of the working directory and
the branch from its HEAD. Requests go through gh::gh(), so the token
is read from GITHUB_PAT, GITHUB_TOKEN or the git credential store
(see gh::gh_token()); it is never an argument.
A job log can produce these kinds of finding:
check_error,check_warning,check_note: anR CMD checkentry.test_failure: a testthat failure or error, with the test file and line.lint: a lintr annotation.format: a fileair format --checkwould reformat.unparsed: a failed job none of the above explains.messageholds the raw log of the failing step, so nothing is dropped silently.timed_out,cancelled: a job that ended that way;messageis the conclusion andstepthe step it ended in. Its log is not read.
Examples
if (FALSE) { # \dontrun{
findings <- ci_failures()
findings[findings$kind == "test_failure", c("file", "line", "message")]
} # }