diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index 95b01a8..7f08313 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -50,7 +50,6 @@ jobs: env: GH_PR_NUMBER: ${{ github.event.pull_request.number }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GH_COMMIT_SHA: "none" - name: Run Validation - Synchronize if: ( github.event.action == 'synchronize' ) diff --git a/code/validation.R b/code/validation.R index 27d27ee..f0e6a1e 100644 --- a/code/validation.R +++ b/code/validation.R @@ -3,16 +3,15 @@ library(gh) library(dplyr) # Check if validation need to run -print(length(Sys.getenv("GH_COMMIT_SHA"))) +print(nchar(Sys.getenv("GH_COMMIT_SHA"))) -if (length(Sys.getenv("GH_COMMIT_SHA")) > 1) { +if (nchar(Sys.getenv("GH_COMMIT_SHA")) > 1) { test <- gh::gh(paste0("GET /repos/", "midas-network/example_round-scenariohub/commits/", Sys.getenv("GH_COMMIT_SHA"))) check <- grepl("data-processed/", unique(unlist(purrr::map(test$files, "filename")))) } else { - print(Sys.getenv("GH_COMMIT_SHA")) check <- TRUE }