Skip to content

Commit 32b49a7

Browse files
committed
.github/workflows/{e2e,test}: check out sha instead of ref
`ref` can be raced between approval and checkout by pushing a commit between approval and checkout. `sha` always refers to the triggering commit, which is safe.
1 parent e0d9824 commit 32b49a7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

.github/workflows/e2e.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
uses: actions/[email protected]
2828
with:
2929
repository: ${{ github.event.pull_request.head.repo.full_name }}
30-
ref: ${{ github.event.pull_request.head.ref }}
30+
ref: ${{ github.event.pull_request.head.sha }}
3131

3232
- uses: actions/setup-go@v5
3333
with:

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
with:
3232
fetch-depth: 0 # for SonarQube
3333
repository: ${{ github.event.pull_request.head.repo.full_name }}
34-
ref: ${{ github.event.pull_request.head.ref }}
34+
ref: ${{ github.event.pull_request.head.sha }}
3535

3636
- name: checkout
3737
if: github.event_name == 'push'

0 commit comments

Comments
 (0)