Skip to content

Commit 37a7bde

Browse files
authored
fix(actions): Ensure build workflow checkouts correct commit SHA (#21631)
When triggered by a workflow_run event, the build workflow was using the default checkout behavior which grabs `github.ref` (whatever is latest for the current workflow) rather than the commit that triggered the original workflow. This fixes the issue by explicitly checking out the commit ID from the original workflow run. This ensures the code being built matches the exact commit that was tested in the previous workflow.
1 parent 7daa3d6 commit 37a7bde

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
runs-on: ubuntu-latest
3737
steps:
3838
- uses: actions/checkout@v4
39+
with:
40+
ref: ${{ github.event.workflow_run.head_commit.id }}
3941

4042
- name: Setup Environment
4143
run: echo "VETS_API_USER_ID=$(id -u)" >> $GITHUB_ENV

0 commit comments

Comments
 (0)