From 1309689621b0dc3eb3733fb06df10b94c440d7eb Mon Sep 17 00:00:00 2001 From: Prem Kumar Kalle Date: Mon, 22 Jun 2026 15:24:20 -0700 Subject: [PATCH] Fix(ci): correct label gate condition to use event.action instead of event_name github.event_name is always 'pull_request_target' for all PR trigger types. The action type (labeled, synchronize, etc.) is exposed via github.event.action, so the safe-to-test label check was never evaluating to true Signed-off-by: Prem Kumar Kalle --- .github/workflows/remove-safe-to-test-label.yml | 2 +- .github/workflows/tests-integration.yml | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/remove-safe-to-test-label.yml b/.github/workflows/remove-safe-to-test-label.yml index 22103723dc..f365c3d3e6 100644 --- a/.github/workflows/remove-safe-to-test-label.yml +++ b/.github/workflows/remove-safe-to-test-label.yml @@ -16,6 +16,6 @@ jobs: if: contains(github.event.pull_request.labels.*.name, 'safe-to-test') steps: - name: Remove safe-to-test label - run: gh pr edit "${{ github.event.pull_request.number }}" --remove-label "safe-to-test" + run: gh pr edit "${{ github.event.pull_request.number }}" --remove-label "safe-to-test" --repo "${{ github.repository }}" env: GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/tests-integration.yml b/.github/workflows/tests-integration.yml index f874f6ed34..2dc00ebf5f 100644 --- a/.github/workflows/tests-integration.yml +++ b/.github/workflows/tests-integration.yml @@ -40,9 +40,11 @@ jobs: runs-on: ubuntu-latest if: | ${{ github.actor != 'dependabot[bot]' && ( + github.event_name == 'workflow_dispatch' || + github.event_name == 'push' || github.event.pull_request.author_association == 'OWNER' || github.event.pull_request.author_association == 'COLLABORATOR' || - (github.event_name == 'labeled' && + (github.event.action == 'labeled' && github.event.label.name == 'safe-to-test') ) }} outputs: @@ -56,6 +58,9 @@ jobs: elif [[ "${{ github.event_name }}" == "push" ]]; then echo "checkout push request ${{github.event.push.after}}" echo "ref=${{github.event.push.after}}" >> $GITHUB_OUTPUT + elif [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "checkout workflow_dispatch ref ${{ github.sha }}" + echo "ref=${{ github.sha }}" >> $GITHUB_OUTPUT else echo "checkout else ${{ github.event.workflow_run.head_sha }}" echo "ref=${{github.event.workflow_run.head_sha}}" >> $GITHUB_OUTPUT @@ -97,7 +102,7 @@ jobs: - create-cf-env outputs: env-name: ${{ steps.set-name.outputs.env-name }} - if: ${{ always() && github.actor != 'dependabot[bot]' }} + if: ${{ always() && needs.get-sha.result == 'success' && github.actor != 'dependabot[bot]' }} steps: - name: set env name id: set-name