Skip to content

fix: resolve git ref/SHA from checkout instead of GITHUB_REF#9411

Draft
chaptersix wants to merge 2 commits intotemporalio:mainfrom
chaptersix:fix/docker-build-manual-ref-mismatch
Draft

fix: resolve git ref/SHA from checkout instead of GITHUB_REF#9411
chaptersix wants to merge 2 commits intotemporalio:mainfrom
chaptersix:fix/docker-build-manual-ref-mismatch

Conversation

@chaptersix
Copy link
Contributor

@chaptersix chaptersix commented Feb 26, 2026

Summary

  • Fix manual Docker build workflow (workflow_dispatch) tagging images with the
    wrong branch name and SHA. GITHUB_REF/GITHUB_SHA point to the branch the
    workflow was dispatched from, not the inputs.ref that was actually checked out.
  • The build-docker-images composite action now resolves ref and SHA directly from
    the checked-out git tree via git rev-parse HEAD / git symbolic-ref HEAD,
    which is correct regardless of trigger type.
  • Fix the job step summary to also use the resolved SHA instead of GITHUB_SHA.

For workflow_dispatch events, GITHUB_REF and GITHUB_SHA point to the
branch the workflow was dispatched from, not the ref specified in
inputs.ref. This caused Docker images to be tagged with the wrong
branch name and SHA.

The build-docker-images composite action now resolves the ref and SHA
directly from the checked-out git tree, which is correct regardless of
trigger type.
@chaptersix chaptersix force-pushed the fix/docker-build-manual-ref-mismatch branch from 4c3ec5c to 3572f22 Compare February 26, 2026 22:38
@chaptersix chaptersix marked this pull request as ready for review February 26, 2026 23:30
@chaptersix chaptersix requested review from a team as code owners February 26, 2026 23:30
Comment on lines +66 to +67
REF=$(git symbolic-ref HEAD 2>/dev/null || git describe --tags --exact-match HEAD 2>/dev/null || git rev-parse HEAD)
echo "ref=${REF}" >> "$GITHUB_OUTPUT"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to double check this one

@chaptersix chaptersix marked this pull request as draft February 26, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant