4
4
pull_request_target :
5
5
workflow_run :
6
6
workflows : ['Run tests for PR']
7
- types : [requested, completed]
7
+ types : [completed]
8
8
9
9
concurrency :
10
- group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.workflow_run.pull_requests[0].number }}
10
+ group : ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.workflow_run.head_branch }}
11
11
cancel-in-progress : true
12
12
13
13
jobs :
14
+ restore-pr :
15
+ if : github.event_name == 'workflow_run'
16
+ runs-on : ubuntu-latest
17
+ outputs :
18
+ pr-number : ${{ steps.pr-info.outputs.pr-number }}
19
+ steps :
20
+ - name : Download PR info
21
+ uses : dawidd6/action-download-artifact@v6
22
+ with :
23
+ name : pr_number
24
+ path : pr/
25
+ run_id : ${{ github.event.workflow_run.id }}
26
+ - name : Store PR number
27
+ id : pr-info
28
+ run : echo "pr-number=$(cat pr/pr_number)" >> $GITHUB_OUTPUT
14
29
reviewdog :
15
30
if : github.event_name == 'workflow_run'
31
+ needs :
32
+ - restore-pr
16
33
strategy :
17
34
matrix :
18
35
include :
26
43
steps :
27
44
- name : ' Checkout Repository'
28
45
uses : actions/checkout@v4
29
- - run : echo "${{ toJson(github.event) }}"
30
- - name : Download benchmark results
46
+ - name : Download style reports
31
47
uses : dawidd6/action-download-artifact@v6
32
48
with :
33
49
name : style-reports
@@ -40,10 +56,10 @@ jobs:
40
56
- name : Run reviewdog ${{ matrix.tool }}
41
57
env :
42
58
REVIEWDOG_GITHUB_API_TOKEN : ${{ secrets.GITHUB_TOKEN }}
43
- CI_PULL_REQUEST : ${{ github.event.workflow_run.pull_requests[0]. number }}
59
+ CI_PULL_REQUEST : ${{ needs.restore-pr.outputs.pr- number }}
44
60
CI_REPO_OWNER : ${{ github.repository_owner }}
45
61
CI_REPO_NAME : ${{ github.event.repository.name }}
46
- CI_COMMIT : ${{ github.event.workflow_run.pull_requests[0].head.sha }}
62
+ CI_COMMIT : ${{ github.event.workflow_run.head_sha }}
47
63
run : echo reports/${{ matrix.tool }}-reviewdog.out | reviewdog -tee -reporter=github-pr-review -name=${{ matrix.tool }} -efm="${{ matrix.error-format }}"
48
64
danger-check :
49
65
if : github.event_name == 'pull_request_target'
64
80
upload-coverage :
65
81
runs-on : ubuntu-latest
66
82
if : github.event.workflow_run.actor.name != 'dependabot[bot]' && github.event.workflow_run.conclusion == 'success'
83
+ needs :
84
+ - restore-pr
67
85
steps :
68
86
- name : ' Checkout Repository'
69
87
uses : actions/checkout@v4
79
97
- name : Upload coverage reports to Codecov
80
98
uses : codecov/codecov-action@v4
81
99
with :
82
- override_branch : ${{ github.event.workflow_run.pull_requests[0].head.ref }}
83
- override_commit : ${{ github.event.workflow_run.pull_requests[0].head.sha }}
84
- override_pr : ${{ github.event.workflow_run.pull_requests[0]. number }}
100
+ override_branch : ${{ github.event.workflow_run.head_branch }}
101
+ override_commit : ${{ github.event.workflow_run.head_sha }}
102
+ override_pr : ${{ needs.restore-pr.outputs.pr- number }}
85
103
token : ${{ secrets.CODECOV_TOKEN }}
0 commit comments