use FETCH_HEAD for tag-on-main ancestry check #126

Merged
AhmedHanafy725 merged 1 commit from development into main 2026-04-30 13:37:24 +00:00
Member

The checkout step does git clone --branch "$BRANCH" --depth 100, which
git treats as --single-branch. That populates only the tag's branch
ref, not refs/remotes/origin/main, so the previous origin/main lookup
failed with "fatal: Not a valid object name origin/main" and the
ancestry guard always rejected the tag.

git fetch origin main updates FETCH_HEAD even on a single-branch
clone, so use FETCH_HEAD as the ancestry target instead.

The checkout step does git clone --branch "$BRANCH" --depth 100, which git treats as --single-branch. That populates only the tag's branch ref, not refs/remotes/origin/main, so the previous origin/main lookup failed with "fatal: Not a valid object name origin/main" and the ancestry guard always rejected the tag. git fetch origin main updates FETCH_HEAD even on a single-branch clone, so use FETCH_HEAD as the ancestry target instead.
fix(ci): use FETCH_HEAD for tag-on-main ancestry check
Some checks failed
CI / build (push) Successful in 2m19s
Build Linux / build-linux (linux-amd64-musl, false, x86_64-unknown-linux-musl) (push) Failing after 2s
Build Linux / build-linux (linux-arm64-gnu, true, aarch64-unknown-linux-gnu) (push) Failing after 1s
CI / build (pull_request) Successful in 2m21s
1b777077c7
The checkout step does git clone --branch "$BRANCH" --depth 100, which
git treats as --single-branch. That populates only the tag's branch
ref, not refs/remotes/origin/main, so the previous origin/main lookup
failed with "fatal: Not a valid object name origin/main" and the
ancestry guard always rejected the tag.

git fetch origin main updates FETCH_HEAD even on a single-branch
clone, so use FETCH_HEAD as the ancestry target instead.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_whiteboard!126
No description provided.