Skip to content

Commit e728fda

Browse files
authored
actions: debug pull_request_target (#551)
1 parent 968f125 commit e728fda

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

.github/workflows/main.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,15 @@ on:
77
pull_request_target:
88
branches:
99
- main
10+
pull_request:
11+
branches:
12+
- main
13+
paths:
14+
- .github/workflows/main.yml
1015
workflow_dispatch:
1116

1217
concurrency:
13-
group: ${{ github.workflow }}-${{ github.head_ref }}
18+
group: ${{ github.workflow }}-${{ github.head_ref }}-${{ github.event_name }}
1419
cancel-in-progress: true
1520

1621
permissions:
@@ -32,8 +37,7 @@ jobs:
3237
- uses: actions/checkout@v6
3338
with:
3439
fetch-depth: 0
35-
ref: ${{ github.event_name == 'pull_request_target' && github.head_ref || github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
36-
# ref: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.sha || github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref_name }}
40+
ref: ${{ github.event_name == 'pull_request_target' && github.head_ref || github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref_name }}
3741
token: ${{ secrets.MY_GITHUB_TOKEN || github.token }}
3842
- name: Run ShellCheck
3943
uses: ludeeus/action-shellcheck@2.0.0
@@ -70,9 +74,10 @@ jobs:
7074
PROGRESS_CFG_BASE64: ${{ secrets.PROGRESS_CFG_BASE64 }}
7175
steps:
7276
- uses: actions/checkout@v6
77+
continue-on-error: true
7378
with:
7479
fetch-depth: 0
75-
ref: ${{ github.event_name == 'pull_request_target' && github.head_ref || github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
80+
ref: ${{ github.event_name == 'pull_request_target' && github.head_ref || github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref_name }}
7681
- run: ./scripts/run_test_wrapper.sh
7782
- run: ./scripts/sonar_test_results_merge.sh
7883
- name: SonarQube Scan - main
@@ -104,7 +109,7 @@ jobs:
104109
- uses: actions/checkout@v6
105110
with:
106111
fetch-depth: 0
107-
ref: ${{ github.event_name == 'pull_request_target' && github.head_ref || github.event_name == 'pull_request' && github.head_ref || github.ref_name }}
112+
ref: ${{ github.event_name == 'pull_request_target' && github.head_ref || github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.ref_name }}
108113
- uses: actions/download-artifact@v8
109114
with:
110115
name: package-artifact

0 commit comments

Comments
 (0)