Skip to content

Commit 8456a8e

Browse files
cquil11claude
andcommitted
fix: pin workflow checkouts to github.sha instead of github.ref
github.ref resolves to the branch name (refs/heads/<branch>) for workflow_dispatch events, so long-queued matrix jobs would check out whatever was at HEAD when the runner picked them up — not the commit that was HEAD at dispatch time. This meant a sweep could end up running across multiple commits if the branch was updated mid-sweep. Switch the fallback to github.sha, which for workflow_dispatch is the SHA at dispatch time and is inherited by reusable workflows from the caller's context. All jobs in a single run now use the same commit. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9a06d22 commit 8456a8e

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/benchmark-multinode-tmpl.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ jobs:
175175
with:
176176
token: ${{ secrets.REPO_PAT }}
177177
fetch-depth: 1
178-
ref: ${{ inputs.ref || github.ref }}
178+
ref: ${{ inputs.ref || github.sha }}
179179
clean: true
180180
submodules: true
181181

.github/workflows/benchmark-tmpl.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ jobs:
167167
with:
168168
token: ${{ secrets.REPO_PAT }}
169169
fetch-depth: 0
170-
ref: ${{ inputs.ref || github.ref }}
170+
ref: ${{ inputs.ref || github.sha }}
171171
clean: true
172172
submodules: true
173173

.github/workflows/e2e-tests.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151
- name: Checkout code (default)
5252
if: ${{ !inputs.ref || inputs.ref == '' }}
5353
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
54+
with:
55+
ref: ${{ github.sha }}
5456

5557
- id: get-jobs
5658
run: |

0 commit comments

Comments
 (0)