-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathresults.R
23 lines (22 loc) · 1.02 KB
/
results.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
first <- tools:::check_packages_in_dir_results('.')[1]
package <- names(first)
results <- first[[1]]
writeLines(paste0('CHECKSTATUS=',results$status),Sys.getenv("GITHUB_OUTPUT"))
writeLines(results$lines, 'checkresults.txt')
if(results$status == 'ERROR'){
details <- tools:::check_packages_in_dir_details('.')
writeLines(paste(format(details), collapse = "\n\n"), "checkdetails.txt")
errors <- details[details$Status=='ERROR',]
errors$Flags <- NULL
errors$Package <- NULL
errmsg <- paste(format(errors), collapse = "\n\n")
cat(sprintf("::error file=%s::%s\n", package, gsub("\n", "%0A", errmsg, fixed = TRUE)))
} else if(results$status == 'WARNING'){
details <- tools:::check_packages_in_dir_details('.')
writeLines(paste(format(details), collapse = "\n\n"), "checkdetails.txt")
errors <- details[details$Status=='WARNING',]
errors$Flags <- NULL
errors$Package <- NULL
errmsg <- paste(format(errors), collapse = "\n\n")
cat(sprintf("::warning file=%s::%s\n", package, gsub("\n", "%0A", errmsg, fixed = TRUE)))
}