Skip to content
This repository was archived by the owner on Feb 28, 2024. It is now read-only.

Commit a16e311

Browse files
Add Sonar support for forked PRs
1 parent 23c3ba7 commit a16e311

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/sonar.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: Set up Ruby
1722
uses: ruby/setup-ruby@v1
1823
with:

0 commit comments

Comments
 (0)