Skip to content

Commit 656ad41

Browse files
bkboothclaude
andcommitted
fix(ci): use head SHA instead of branch ref for checkout
Checking out by branch name rather than SHA means if someone pushes to the branch between the event firing and the checkout step, the workflow could build the wrong code. Pin to the exact commit SHA instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 02a5055 commit 656ad41

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

.github/workflows/pixel-bundle-size.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Checkout code
2424
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.1
2525
with:
26-
ref: ${{ github.event.pull_request.head.ref }}
26+
ref: ${{ github.event.pull_request.head.sha }}
2727
fetch-depth: 0
2828

2929
- name: Setup

.github/workflows/pr.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
- name: Checkout code
2020
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.1
2121
with:
22-
ref: ${{ github.event.pull_request.head.ref }}
22+
ref: ${{ github.event.pull_request.head.sha }}
2323
fetch-depth: 0
2424

2525
- name: setup
@@ -35,7 +35,7 @@ jobs:
3535
- name: Checkout code
3636
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.1
3737
with:
38-
ref: ${{ github.event.pull_request.head.ref }}
38+
ref: ${{ github.event.pull_request.head.sha }}
3939
fetch-depth: 0
4040

4141
- name: setup
@@ -53,7 +53,7 @@ jobs:
5353
- name: Checkout
5454
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.1
5555
with:
56-
ref: ${{ github.event.pull_request.head.ref }}
56+
ref: ${{ github.event.pull_request.head.sha }}
5757
fetch-depth: 0
5858

5959
- name: Setup
@@ -116,7 +116,7 @@ jobs:
116116
- name: Checkout code
117117
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # pin@v6.0.1
118118
with:
119-
ref: ${{ github.event.pull_request.head.ref }}
119+
ref: ${{ github.event.pull_request.head.sha }}
120120
fetch-depth: 0
121121

122122
- name: setup

0 commit comments

Comments
 (0)