Skip to content

Commit

Permalink
Show error message as GHA annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Nov 29, 2024
1 parent 4ca5297 commit 7122bed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ COPY entrypoint.sh /entrypoint.sh

RUN installr -d -t "openssl-dev libgit2-dev" -a "openssl libgit2 git" rlang local::/pkg

RUN echo 'options(error=rlang::entrace)' >> "$(R RHOME)/etc/Rprofile.site"
RUN echo 'rlang::global_entrace()' >> "$(R RHOME)/etc/Rprofile.site"

ENTRYPOINT ["sh","/entrypoint.sh"]
6 changes: 4 additions & 2 deletions R/monorepos.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ sync_from_registry <- function(monorepo_url = Sys.getenv('MONOREPO_URL')){
}
check_new_release_tags()
skiplist <- submodules_up_to_date(skip_broken = FALSE)
print_message("Submodules up-to-date:\n %s", paste(skiplist, collapse = '\n '))
print_message("Submodules up-to-date:\n %d", length(skiplist))
dirty <- Filter(function(x){is.na(match(x$package, skiplist))}, registry[!registry_dups])
results1 <- lapply(dirty, try_update_package, update_pkg_remotes = TRUE)

Expand Down Expand Up @@ -150,7 +150,9 @@ sync_from_registry <- function(monorepo_url = Sys.getenv('MONOREPO_URL')){

if(length(failures) > 0){
pkgs <- vapply(failures, function(x){
message(sprintf("\nERROR updating %s from %s (%s)\n", x$package, x$url, attr(x, 'error')))
errmsg <- sprintf("\nERROR updating %s from %s (%s)", x$package, x$url, attr(x, 'error'))
message(errmsg)
cat(sprintf("::error file=.registry::annotation %s\n", errmsg))
x$package
}, character(1))
stop("Failed to update packages: ", paste(pkgs, collapse = ', '))
Expand Down

0 comments on commit 7122bed

Please sign in to comment.