Skip to content

Commit

Permalink
ci(action): prevent duplicate checks on Renovate PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
sheerlox committed Nov 8, 2023
1 parent 17d9fa8 commit ce97a59
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ permissions:
contents: read

jobs:
# prevent duplicate checks on Renovate PRs
prevent-duplicate-checks:
runs-on: ubuntu-latest
steps:
- uses: insurgent-lab/is-in-pr-action@v0.1.3
id: isInPR
outputs:
should-run: ${{ !(steps.isInPR.outputs.result == 'true' && startsWith(github.ref, 'refs/heads/renovate/')) }}

test_matrix:
strategy:
matrix:
Expand All @@ -25,6 +34,9 @@ jobs:
runs-on: ${{ matrix.os }}
timeout-minutes: 10

needs: prevent-duplicate-checks
if: ${{ needs.prevent-duplicate-checks.outputs.should-run == 'true' }}

steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
Expand Down Expand Up @@ -69,7 +81,9 @@ jobs:
sonarcloud:
runs-on: ubuntu-latest
needs:
- prevent-duplicate-checks
- test_matrix
if: ${{ needs.prevent-duplicate-checks.outputs.should-run == 'true' }}
permissions:
pull-requests: read
steps:
Expand Down

0 comments on commit ce97a59

Please sign in to comment.