Skip to content

Commit 4dd34c6

Browse files
committed
ci: use github.event.pull_request.head.sha with full-ci
Usage of `github.event.pull_request.number` unsafe because a user could update a pull request between approve and checkout.
1 parent b237139 commit 4dd34c6

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

.github/workflows/full-ci.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
with:
114114
fetch-depth: 0
115115
submodules: recursive
116-
ref: refs/pull/${{ github.event.pull_request.number }}/merge
116+
ref: refs/pull/${{ github.event.pull_request.head.sha }}/merge
117117

118118
- uses: actions/checkout@v4
119119
if: github.event_name != 'pull_request_target'
@@ -226,7 +226,7 @@ jobs:
226226
with:
227227
fetch-depth: 0
228228
submodules: recursive
229-
ref: refs/pull/${{ github.event.pull_request.number }}/merge
229+
ref: refs/pull/${{ github.event.pull_request.head.sha }}/merge
230230

231231
- uses: actions/checkout@v4
232232
if: github.event_name != 'pull_request_target'
@@ -282,7 +282,7 @@ jobs:
282282
with:
283283
fetch-depth: 0
284284
submodules: recursive
285-
ref: refs/pull/${{ github.event.pull_request.number }}/merge
285+
ref: refs/pull/${{ github.event.pull_request.head.sha }}/merge
286286

287287
- uses: actions/checkout@v4
288288
if: github.event_name != 'pull_request_target'
@@ -331,7 +331,7 @@ jobs:
331331
with:
332332
fetch-depth: 0
333333
submodules: recursive
334-
ref: refs/pull/${{ github.event.pull_request.number }}/merge
334+
ref: refs/pull/${{ github.event.pull_request.head.sha }}/merge
335335

336336
- uses: actions/checkout@v4
337337
if: github.event_name != 'pull_request_target'

.github/workflows/tests.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ jobs:
112112
with:
113113
fetch-depth: 0
114114
submodules: recursive
115-
ref: refs/pull/${{ github.event.pull_request.number }}/merge
115+
ref: refs/pull/${{ github.event.pull_request.head.sha }}/merge
116116

117117
- uses: actions/checkout@v4
118118
if: github.event_name != 'pull_request_target'

0 commit comments

Comments
 (0)