From cb1246033b17d2d2aa117083f4c097345c852943 Mon Sep 17 00:00:00 2001 From: Pawel Rucki <12943682+pawelru@users.noreply.github.com> Date: Tue, 6 Aug 2024 09:30:13 +0200 Subject: [PATCH] replace return() with q() in the script (#2) `return()` makes the step fail - we need to replace it with something else to exit quietly and continue --- action.yaml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/action.yaml b/action.yaml index 4d38eb8..617bcd5 100644 --- a/action.yaml +++ b/action.yaml @@ -183,17 +183,20 @@ runs: cat("::group::Assertions\n") if (isFALSE(file.exists(file.path(path, "DESCRIPTION")))) { cli::cli_alert_danger("{.file DESCRIPTION} file not found in {.path {path}}. Skipping.") - return() + cat("::endgroup::\n") + q(save = "no") } if (length(lookup_refs) == 0 || identical(lookup_refs, "")) { cli::cli_alert_danger("No lookup refs provided. Skipping.") - return() + cat("::endgroup::\n") + q(save = "no") } parsed_lookup_refs <- pkgdepends::parse_pkg_refs(lookup_refs) if (any(!vapply(parsed_lookup_refs, is, logical(1), "remote_ref_github"))) { incorrect_idx <- which(!vapply(parsed_lookup_refs, is, logical(1), "remote_ref_github")) cli::cli_alert_danger("All lookup refs must be GH refs. Incorrect refs: {.val {lookup_refs[incorrect_idx]}}.") - return() + cat("::endgroup::\n") + q(save = "no") } cat("::endgroup::\n") @@ -268,17 +271,20 @@ runs: cat("::group::Assertions\n") if (isFALSE(file.exists(file.path(path, "DESCRIPTION")))) { cli::cli_alert_danger("{.file DESCRIPTION} file not found in {.path {path}}. Skipping.") - return() + cat("::endgroup::\n") + q(save = "no") } if (length(lookup_refs) == 0 || identical(lookup_refs, "")) { cli::cli_alert_danger("No lookup refs provided. Skipping.") - return() + cat("::endgroup::\n") + q(save = "no") } parsed_lookup_refs <- pkgdepends::parse_pkg_refs(lookup_refs) if (any(!vapply(parsed_lookup_refs, is, logical(1), "remote_ref_github"))) { incorrect_idx <- which(!vapply(parsed_lookup_refs, is, logical(1), "remote_ref_github")) cli::cli_alert_danger("All lookup refs must be GH refs. Incorrect refs: {.val {lookup_refs[incorrect_idx]}}.") - return() + cat("::endgroup::\n") + q(save = "no") } cat("::endgroup::\n")