Skip to content

Commit 2553d4c

Browse files
* Updating sonar workflow file to fail on un-safe forked PRs
1 parent 8bb585d commit 2553d4c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/sonar-scan.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@ name: Sonar
1111
jobs:
1212
build:
1313
runs-on: ubuntu-latest
14-
if: contains(github.event.pull_request.labels.*.name, 'tests can be run') ||
15-
github.event.pull_request.head.repo.full_name == github.repository ||
16-
github.event_name != 'pull_request_target'
1714
steps:
1815
- uses: actions/checkout@v2
1916
with:
2017
fetch-depth: 0
18+
- name: Check for external PR
19+
if: ${{ !(contains(github.event.pull_request.labels.*.name, 'safe') ||
20+
github.event.pull_request.head.repo.full_name == github.repository ||
21+
github.event_name != 'pull_request_target') }}
22+
run: echo "Unsecure PR, must be labelled with the 'safe' label, then run the workflow again" && exit 1
2123
- name: Set up JDK
2224
uses: actions/setup-java@v1
2325
with:

0 commit comments

Comments
 (0)