From 6e5c7c84c0f9d851df44fd5bd68d7935a34075f4 Mon Sep 17 00:00:00 2001 From: Andy Roth Date: Tue, 3 Oct 2023 17:56:47 -0700 Subject: [PATCH] chore: fix test-exemption job (#37) --- .github/workflows/trigger-tests.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/trigger-tests.yml b/.github/workflows/trigger-tests.yml index 6bbf262..95c9bc4 100644 --- a/.github/workflows/trigger-tests.yml +++ b/.github/workflows/trigger-tests.yml @@ -55,9 +55,10 @@ jobs: if: github.event_name == 'merge_group' runs-on: ubuntu-latest outputs: - # return 'false' if any files in the PR are not exempt, otherwise return 'true' - is-exempt: ${{ steps.changed-files.outputs.not-exempt_any_changed == 'true' && 'false' || 'true' }} + # return 'true' if any files in the PR are not exempt + not-exempt: ${{ steps.changed-files.outputs.not-exempt_any_modified }} steps: + - uses: hmarr/debug-action@v2 - name: checkout uses: actions/checkout@v4 with: @@ -65,8 +66,10 @@ jobs: - name: changed-files uses: tj-actions/changed-files@v39 with: - base_sha: ${{ github.event.pull_request.base.ref || github.event.merge_group.base_ref }} - sha: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} + base_sha: ${{ github.event.merge_group.base_sha }} + sha: ${{ github.event.merge_group.head_sha }} + fail_on_initial_diff_error: true + fail_on_submodule_diff_error: true files_yaml: | not-exempt: - '**' @@ -74,7 +77,7 @@ jobs: skip-tests-if-merge-group-event-and-exemption-criteria-met: needs: test-exemption - if: github.event_name == 'merge_group' && needs.test-exemption.outputs.is-exempt == 'true' + if: github.event_name == 'merge_group' && needs.test-exemption.outputs.not-exempt != 'true' runs-on: ubuntu-latest steps: - name: skip-tests-if-merge-group-event-and-exemption-criteria-met @@ -89,7 +92,7 @@ jobs: test-e2e-on-prem-lite: needs: test-exemption - if: github.event_name == 'merge_group' && needs.test-exemption.outputs.is-exempt == 'false' + if: github.event_name == 'merge_group' && needs.test-exemption.outputs.not-exempt == 'true' runs-on: ubuntu-latest steps: - name: Checkout Repo