Skip to content

Commit

Permalink
Merge pull request #86 from r-lib/session-diff-linebreaks
Browse files Browse the repository at this point in the history
More tweaks re: extracting session info from GHA logs
  • Loading branch information
gaborcsardi authored Apr 18, 2023
2 parents 994354e + ddb7ad8 commit 444cabb
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion R/github-actions.R
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ get_session_info_gha <- function(url) {
)
html_urls <- vapply(jobs[["jobs"]], function(x) x[["html_url"]], "")
i <- which(html_urls == url)
if (length(i) == 0) {
stop("Failed to find the job associated with '", url, "'; perhaps there was a later attempt?")
}
dat$job_id <- jobs[["jobs"]][[i]][["id"]]

meta <- gh::gh(
Expand All @@ -78,7 +81,7 @@ get_session_info_gha <- function(url) {
"/repos/{owner}/{repo}/actions/jobs/{job_id}/logs",
owner = dat$owner, repo = dat$repo, job_id = dat$job_id
)
timestamped_lines <- unlist(strsplit(raw_log$message, split = "\r\n"))
timestamped_lines <- unlist(strsplit(raw_log$message, split = "\r\n|\n"))
lines <- sub("^[^\\s]+\\s+", "", timestamped_lines, perl = TRUE)

re_start <- "[-=\u2500\u2550][ ]Session info[ ]"
Expand Down

0 comments on commit 444cabb

Please # to comment.