Skip to content

Commit 4abf81b

Browse files
Add Sonar support for forked PRs
1 parent 7f852fa commit 4abf81b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/sonar.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ name: Sonar
44
branches:
55
- main
66
pull_request_target:
7-
types:
8-
- opened
9-
- synchronize
10-
- reopened
7+
branches:
8+
- main
119
schedule:
1210
- cron: 0 16 * * *
1311
jobs:
@@ -18,6 +16,11 @@ jobs:
1816
- uses: actions/checkout@v2
1917
with:
2018
fetch-depth: 0
19+
- name: Check for external PR
20+
if: ${{ !(contains(github.event.pull_request.labels.*.name, 'safe') ||
21+
github.event.pull_request.head.repo.full_name == github.repository ||
22+
github.event_name != 'pull_request_target') }}
23+
run: echo "Unsecure PR, must be labelled with the 'safe' label, then run the workflow again" && exit 1
2124
- name: Set up Python 3.8
2225
uses: actions/setup-python@v2
2326
with:

0 commit comments

Comments
 (0)