Skip to content

Fix release pipeline: check remote for existing tag before pushing#149

Merged
JerrettDavis merged 1 commit intomainfrom
copilot/fix-release-pipeline-workflow
Apr 20, 2026
Merged

Fix release pipeline: check remote for existing tag before pushing#149
JerrettDavis merged 1 commit intomainfrom
copilot/fix-release-pipeline-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 20, 2026

Summary

The release pipeline was failing with:

! [rejected]        v0.15.29 -> v0.15.29 (already exists)
error: failed to push some refs to 'https://github.com/JerrettDavis/JD.Efcpt.Build'
hint: Updates were rejected because the tag already exists in the remote.

Root Cause

The "Create and push git tag" step used git rev-parse "v${PACKAGE_VERSION}" to check if a tag already existed — but this only checks local refs. If a previous run had already pushed the tag to the remote, but the current run's local repo didn't have that tag fetched, the check would pass and the push would be attempted, only to be rejected by the remote.

Fix

Replaced git rev-parse with git ls-remote --exit-code --tags origin "refs/tags/v${PACKAGE_VERSION}", which queries the remote directly. This correctly detects an already-existing remote tag and skips the push.

@JerrettDavis JerrettDavis marked this pull request as ready for review April 20, 2026 15:55
@JerrettDavis JerrettDavis self-requested a review as a code owner April 20, 2026 15:55
@JerrettDavis JerrettDavis merged commit 0bfe755 into main Apr 20, 2026
1 check passed
Copilot stopped work on behalf of JerrettDavis due to an error April 20, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants