Skip to content

Commit 435892a

Browse files
committed
Merge branch 'feature/fix-sonar-scanner-fork'
1 parent 184c838 commit 435892a

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

.github/workflows/sonar-scanner.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,25 @@ name: Sonar
22
'on':
33
push:
44
branches:
5-
- main
5+
- "**"
66
pull_request_target:
77
branches:
8-
- main
8+
- "**"
9+
types: [opened, synchronize, reopened, labeled]
910
schedule:
1011
- cron: 0 14 * * *
1112
jobs:
1213
sonarcloud:
1314
runs-on: ubuntu-latest
1415
steps:
15-
- uses: actions/checkout@v2
16-
with:
17-
fetch-depth: 0
1816
- name: Check for external PR
1917
if: ${{ !(contains(github.event.pull_request.labels.*.name, 'safe') ||
2018
github.event.pull_request.head.repo.full_name == github.repository ||
2119
github.event_name != 'pull_request_target') }}
2220
run: echo "Unsecure PR, must be labelled with the 'safe' label, then run the workflow again" && exit 1
21+
- uses: actions/checkout@v3
22+
with:
23+
ref: ${{ github.event.pull_request.head.sha }}
2324
- name: Use Node.js 13
2425
uses: actions/setup-node@v1
2526
with:
@@ -43,3 +44,5 @@ jobs:
4344
-Dsonar.tests=./test
4445
-Dsonar.coverage.jacoco.xmlReportPaths=test-results.xml
4546
-Dsonar.javascript.lcov.reportPaths=.nyc_output/coverage.lcov
47+
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
48+
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }}

0 commit comments

Comments
 (0)