From eadfb9295975a5a751379fe8084b0fd7792b88dd Mon Sep 17 00:00:00 2001 From: Rafe Colton Date: Tue, 6 May 2025 18:56:36 -0700 Subject: [PATCH 1/3] Only run ajv if there are files to check or else it errors --- .github/scripts/validateWorkflowSchemas.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/scripts/validateWorkflowSchemas.sh b/.github/scripts/validateWorkflowSchemas.sh index d9fbaef..eaa98d5 100755 --- a/.github/scripts/validateWorkflowSchemas.sh +++ b/.github/scripts/validateWorkflowSchemas.sh @@ -38,12 +38,12 @@ echo ACTIONS="$(find "$REPO_ROOT" -type f \( -name "action.yml" -o -name "action.yaml" \) -exec echo -n " -d "{} \;)" if [[ -z "$ACTIONS" ]]; then warning "No actions found. Did you remember to run this script from the root of a repo?" >&2 -fi - -# Disabling shellcheck because we WANT word-splitting on ACTIONS in this case -# shellcheck disable=SC2086 -if ! npx ajv --strict=false -s "$TEMP_SCHEMA_DIR/github-action.json" $ACTIONS; then - EXIT_CODE=1 +else + # Disabling shellcheck because we WANT word-splitting on ACTIONS in this case + # shellcheck disable=SC2086 + if ! npx ajv --strict=false -s "$TEMP_SCHEMA_DIR/github-action.json" $ACTIONS; then + EXIT_CODE=1 + fi fi echo @@ -54,11 +54,11 @@ echo WORKFLOWS="$(find "${REPO_ROOT}/.github/workflows" -type f \( -name "*.yml" -o -name "*.yaml" \) -exec echo -n " -d "{} \;)" if [[ -z "$WORKFLOWS" ]]; then warning "No workflows found. Did you remember to run this script from the root of a repo?" >&2 -fi - -# shellcheck disable=SC2086 -if ! npx ajv --strict=false -s "$TEMP_SCHEMA_DIR/github-workflow.json" $WORKFLOWS; then - EXIT_CODE=1 +else + # shellcheck disable=SC2086 + if ! npx ajv --strict=false -s "$TEMP_SCHEMA_DIR/github-workflow.json" $WORKFLOWS; then + EXIT_CODE=1 + fi fi echo From d11bffb861421986306aadb82951f447f4907a1b Mon Sep 17 00:00:00 2001 From: Rafe Colton Date: Tue, 6 May 2025 18:56:46 -0700 Subject: [PATCH 2/3] Some actions can live outside .github so always run this (it's fast) --- .github/workflows/validateActions.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/validateActions.yml b/.github/workflows/validateActions.yml index ca6f66f..9a98343 100644 --- a/.github/workflows/validateActions.yml +++ b/.github/workflows/validateActions.yml @@ -4,7 +4,6 @@ on: pull_request: types: [opened, synchronize] branches-ignore: [staging, production] - paths: ['.github/**'] jobs: validateSchemas: From f594a198795542f2c1e28a178dcda3f0c830f001 Mon Sep 17 00:00:00 2001 From: Rafe Colton Date: Tue, 6 May 2025 19:00:17 -0700 Subject: [PATCH 3/3] Add required description --- checkoutRepoAndGitHubActions/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/checkoutRepoAndGitHubActions/action.yml b/checkoutRepoAndGitHubActions/action.yml index d19eaaf..f8647e9 100644 --- a/checkoutRepoAndGitHubActions/action.yml +++ b/checkoutRepoAndGitHubActions/action.yml @@ -1,4 +1,5 @@ name: Checkout target repo and GitHub Actions repo +description: Checkout target repo and GitHub Actions repo outputs: NAME: