Skip to content

Fix(CI): Ensure correct branch SHA1 is fetched in manual release workflow #1588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 11, 2025

Conversation

ErikJiang
Copy link
Member

@ErikJiang ErikJiang commented Jul 11, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:

The git ls-remote command in the manual kubespray release workflow was not specific enough and could retrieve the SHA1 from an incorrect branch if another branch name contained the target branch name as a substring.

For example, when targeting the release-2.28 branch, the old command might incorrectly match component_hash_update/release-2.28:

$ git ls-remote -h https://github.com/kubernetes-sigs/kubespray.git release-2.28
c13134b88117bc35d05b77c26e1cc5f80aea5624	refs/heads/component_hash_update/release-2.28
2d0cc2b4ea1a5f578300536d711d10c626c390bb	refs/heads/release-2.28

This PR fixes the issue by specifying the full ref path refs/heads/, which ensures the command always resolves to the exact branch head, preventing ambiguity.

$ git ls-remote -h https://github.com/kubernetes-sigs/kubespray.git refs/heads/release-2.28
2d0cc2b4ea1a5f578300536d711d10c626c390bb	refs/heads/release-2.28

Which issue(s) this PR fixes:

Fixes #1589

Special notes for your reviewer:

@ErikJiang ErikJiang added kind/bug Categorizes issue or PR as related to a bug. bug labels Jul 11, 2025
@ErikJiang ErikJiang self-assigned this Jul 11, 2025
@ErikJiang ErikJiang requested a review from 0ekk July 11, 2025 08:03
@ErikJiang ErikJiang force-pushed the fix_ci_obtains_branch_sha1 branch 2 times, most recently from 30a8e04 to dfe6cd6 Compare July 11, 2025 08:25
@ErikJiang ErikJiang force-pushed the fix_ci_obtains_branch_sha1 branch from dfe6cd6 to 92fd6af Compare July 11, 2025 08:48
@ErikJiang ErikJiang merged commit dd3bafd into kubean-io:main Jul 11, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use exact ref to get branch SHA1
2 participants