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

Commit 509efae

Browse files
Add Sonar support for forked PRs
1 parent 36f1002 commit 509efae

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:
@@ -15,6 +15,11 @@ jobs:
1515
- uses: actions/checkout@v2
1616
with:
1717
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
1823
- name: Install PHP
1924
uses: shivammathur/setup-php@v2
2025
with:

0 commit comments

Comments
 (0)