From 64a2f0c320ede17d251a4a8a7a44d0f4c6a69aa7 Mon Sep 17 00:00:00 2001 From: Tyler Hendrickson Date: Wed, 1 May 2024 13:37:05 -0500 Subject: [PATCH] Fix: validate-deployment.yml job can't find deployment ref (#238) * Bump actions/checkout version * Ensure checkout fetches deployment ref * Don't run "Fail validation" step if job is already failing --- .github/workflows/validate-deployment.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/validate-deployment.yml b/.github/workflows/validate-deployment.yml index 6ee04286..889c89a5 100644 --- a/.github/workflows/validate-deployment.yml +++ b/.github/workflows/validate-deployment.yml @@ -37,9 +37,11 @@ jobs: with: disable-sudo: true egress-policy: audit - - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 with: ref: ${{ env.PROTECTED_REF }} + fetch-depth: '0' + filter: 'tree:0' show-progress: 'false' persist-credentials: 'false' - name: Count commits in candidate ref that are not in protected ref @@ -69,7 +71,7 @@ jobs: INVALID_CHERRY_COUNT: ${{ steps.missing-cherries.outputs.count }} CHERRY_FILE: ${{ steps.all-cherries.outputs.file }} - name: Fail validation - if: fromJson(steps.missing-cherries.outputs.count) > 0 + if: success() && fromJson(steps.missing-cherries.outputs.count) > 0 uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 with: script: |