Skip to content

Commit e5a2a3e

Browse files
Add Sonar support for forked PRs
1 parent f53fc52 commit e5a2a3e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/sonar-scanner.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Sonar
33
push:
44
branches:
55
- main
6-
pull_request:
6+
pull_request_target:
77
branches:
88
- main
99
schedule:
@@ -13,6 +13,11 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/checkout@v2
16+
- name: Check for external PR
17+
if: ${{ !(contains(github.event.pull_request.labels.*.name, 'safe') ||
18+
github.event.pull_request.head.repo.full_name == github.repository ||
19+
github.event_name != 'pull_request_target') }}
20+
run: echo "Unsecure PR, must be labelled with the 'safe' label, then run the workflow again" && exit 1
1621
- name: Use Node.js 13
1722
uses: actions/setup-node@v1
1823
with:

0 commit comments

Comments
 (0)