Skip to content

Commit b1e3958

Browse files
sonarcloud: fix on pull request event
Run sonarcloud workflow on pull request instead of pull request target. Signed-off-by: Giacomo Dematteis <[email protected]>
1 parent 416d002 commit b1e3958

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

.github/workflows/sonarcloud.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
paths-ignore:
77
- ".github/workflows/docs-build-and-publish.yml"
88
- "docs/**"
9-
pull_request_target:
9+
pull_request:
1010
paths:
1111
- '**/*.c'
1212
- '**/*.h'
@@ -24,14 +24,14 @@ jobs:
2424
CMAKE_PREFIX_PATH: /opt/toolchains
2525
steps:
2626
- uses: actions/checkout@v4
27-
if: github.event_name == 'pull_request_target'
27+
if: github.event_name == 'pull_request'
2828
with:
2929
ref: ${{ github.event.pull_request.head.sha }}
3030
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
3131
path: thingy91x-oob
3232

3333
- uses: actions/checkout@v4
34-
if: github.event_name != 'pull_request_target'
34+
if: github.event_name != 'pull_request'
3535
with:
3636
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
3737
path: thingy91x-oob
@@ -66,7 +66,7 @@ jobs:
6666
6767
- name: Run sonar-scanner on main
6868
working-directory: thingy91x-oob
69-
if: github.event_name != 'pull_request_target'
69+
if: github.event_name != 'pull_request'
7070
env:
7171
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7272
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
@@ -80,7 +80,7 @@ jobs:
8080
8181
- name: Run sonar-scanner on PR
8282
working-directory: thingy91x-oob
83-
if: github.event_name == 'pull_request_target'
83+
if: github.event_name == 'pull_request'
8484
env:
8585
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8686
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

0 commit comments

Comments
 (0)