DEVEX-1087: handle annotated -main tags in promote-release-candidate#113
DEVEX-1087: handle annotated -main tags in promote-release-candidate#113pdodgen-revparts merged 1 commit intomainfrom
Conversation
When the -main.N tag is annotated (tag object), 'git push +refs/tags/X:refs/heads/Y'
tries to set the branch ref to a tag object, which GitHub rejects with 'remote
rejected' since branch refs must point to commits.
Fix: always resolve via 'git rev-parse TAG^{commit}' (no-op for lightweight tags,
dereferences annotated tags) and push the commit SHA directly instead of the tag ref.
Observed on rp_api, checkout, and internal_api where the tag-action produced annotated
-main tags. Catalog_api happened to have lightweight tags so was unaffected.
PR SummaryMedium Risk Overview This avoids GitHub rejecting branch updates that mistakenly point at tag objects, while preserving behavior for lightweight tags. Reviewed by Cursor Bugbot for commit d60cf45. Bugbot is set up for automated code reviews on this repo. Configure here. |
Fixes
[remote rejected]failures on the "Reset target branch" step when the-main.Ntag is annotated.Root cause
mathieudutour/github-tag-actioncan produce either lightweight or annotated tags. When annotated:git rev-parse TAGreturns the tag object SHA, not the commitgit push +refs/tags/TAG:refs/heads/rctries to set a branch ref to the tag objectCatalog_api happened to have lightweight
-maintags, so the bug was invisible until we rolled out to rp_api, checkout, and internal_api (which have annotated-maintags).Fix
git rev-parse TAG^{commit}(no-op for lightweight, dereferences annotated)+$SHA:refs/heads/rc) instead of the tag refObserved in
-maintag)Part of DEVEX-1087.