Skip to content

Commit 74c4e9e

Browse files
committed
chore: Prevent snyk and sonarcloud runs for 3rd party PRs
1 parent 609d658 commit 74c4e9e

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ jobs:
3636
name: jsonurl-maven-repository
3737
path: snapshot/*
3838
- name: Publish gh-pages
39-
if: |
40-
success()
41-
&& github.repository_owner == 'jsonurl'
42-
&& github.ref == 'refs/heads/main'
39+
if: ${{ success() && github.repository_owner == 'jsonurl' && github.ref == 'refs/heads/main' }}
4340
run: >
4441
script/deploy_ghpages.sh
4542
'doc: Update by action ${{ github.workflow }}.${{ github.job }}/${{ github.run_id }} on behalf of ${{ github.actor }} for ${{ github.event_name }} ${{ github.sha }}'
@@ -50,7 +47,7 @@ jobs:
5047

5148
matrix-build:
5249
needs: artifact
53-
if: needs.artifact.result == 'success'
50+
if: ${{ needs.artifact.result == 'success' }}
5451
runs-on: ${{ matrix.os }}
5552
strategy:
5653
matrix:
@@ -77,9 +74,7 @@ jobs:
7774

7875
snyk:
7976
needs: artifact
80-
if: |
81-
needs.artifact.result == 'success'
82-
&& github.repository_owner == 'jsonurl'
77+
if: ${{ needs.artifact.result == 'success' && github.repository_owner == 'jsonurl' && ( github.event_name == 'push' || github.event.pull_request.author_association == 'OWNER' || github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR' ) }}
8378
runs-on: ubuntu-latest
8479
steps:
8580
- uses: actions/checkout@v2
@@ -90,9 +85,7 @@ jobs:
9085

9186
sonarcloud:
9287
needs: artifact
93-
if: |
94-
needs.artifact.result == 'success'
95-
&& github.repository_owner == 'jsonurl'
88+
if: ${{ needs.artifact.result == 'success' && github.repository_owner == 'jsonurl' && ( github.event_name == 'push' || github.event.pull_request.author_association == 'OWNER' || github.event.pull_request.author_association == 'MEMBER' || github.event.pull_request.author_association == 'COLLABORATOR' ) }}
9689
runs-on: ubuntu-latest
9790
steps:
9891
- uses: actions/checkout@v2

0 commit comments

Comments
 (0)