Skip to content

Commit d0ab1d1

Browse files
authored
Merge pull request #2671 from cta-observatory/fix_sonar
Fix sonar for pull requests
2 parents 7858ddc + 1385b8e commit d0ab1d1

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

.github/workflows/sonar.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,26 @@ jobs:
1919
runs-on: ubuntu-latest
2020
if: github.event.workflow_run.conclusion == 'success'
2121
steps:
22-
- uses: actions/checkout@v4
22+
- name: Checkout branch or tag
23+
uses: actions/checkout@v4
24+
if: github.event.workflow_run.event != 'pull_request'
2325
with:
2426
repository: ${{ github.event.workflow_run.head_repository.full_name }}
2527
ref: ${{ github.event.workflow_run.head_branch }}
2628
fetch-depth: 0
2729

30+
- name: Checkout Pull Request merge result
31+
uses: actions/checkout@v4
32+
if: github.event.workflow_run.event == 'pull_request'
33+
with:
34+
ref: refs/pull/${{ github.event.workflow_run.pull_requests[0].number }}/merge
35+
fetch-depth: 0
36+
37+
- name: Git info
38+
run: |
39+
git status
40+
git log -n 5 --oneline
41+
2842
- name: 'Download code coverage'
2943
uses: actions/github-script@v7
3044
with:

0 commit comments

Comments
 (0)