From ddb7ad83b5008265cb87b6b84965e916c78aa691 Mon Sep 17 00:00:00 2001 From: Jenny Bryan Date: Tue, 18 Apr 2023 09:09:52 -0700 Subject: [PATCH] Cope with more stuff I've seen --- R/github-actions.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/github-actions.R b/R/github-actions.R index 4fabcaa..f7944c5 100644 --- a/R/github-actions.R +++ b/R/github-actions.R @@ -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( @@ -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[ ]"