Skip to content
This repository has been archived by the owner on Mar 8, 2024. It is now read-only.

Commit

Permalink
chore: fix test-exemption job (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
RothAndrew authored Oct 4, 2023
1 parent 9d186bb commit 6e5c7c8
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/trigger-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,26 +55,29 @@ 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:
fetch-depth: 0
- 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:
- '**'
- '!**/*.md'
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
Expand All @@ -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
Expand Down

0 comments on commit 6e5c7c8

Please sign in to comment.