Skip to content

Commit

Permalink
if the id is not found in the commit message, just use the first row …
Browse files Browse the repository at this point in the history
…instead (this is for single jobs, not batches)
  • Loading branch information
yihui committed Nov 15, 2021
1 parent 54f817a commit dbc0e4a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions R/revcheck.R
Original file line number Diff line number Diff line change
Expand Up @@ -493,10 +493,8 @@ crandalf_results = function(pkg, repo = NA, limit = 200, wait = 5 * 60) {
}
}
ids = grep_sub('^(\\d+) checking: .+', '\\1', res[, 3])
if (length(ids) == 0) {
stop('Failed to find the ID in the commit messages.')
}
res = res[grep(sprintf('^%s checking: ', ids[1]), res[, 3]), , drop = FALSE]
i = if (length(ids) > 0) grep(sprintf('^%s checking: ', ids[1]), res[, 3]) else 1
res = res[i, , drop = FALSE]
res = res[res[, 2] == 'failure', , drop = FALSE]
if (NROW(res) == 0) {
stop('Did not find any failed results on Github Actions.')
Expand Down

0 comments on commit dbc0e4a

Please sign in to comment.