Skip to content

Make release publish job idempotent when tag release already exists - #2

Merged
xylophoneengine merged 2 commits into
masterfrom
copilot/fix-failing-publish-job
Sep 4, 2026
Merged

xylophoneengine merged 2 commits into
masterfrom
copilot/fix-failing-publish-job

Conversation

Copilot AI commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

The publish job in the release workflow failed on run 33848099285 because gh release create exits non-zero when a release for the tag already exists. This change makes the publish step safe for reruns and duplicate tag-triggered executions.

  • Root-cause handling

    • Replaces unconditional gh release create with existence-aware logic.
    • Detects whether ${GITHUB_REF_NAME} already has a GitHub release.
  • Publish behavior update

    • If release exists: upload artifacts via gh release upload --clobber.
    • If release does not exist: create release with existing metadata flow (--title, --generate-notes).
  • Scope

    • Touches only .github/workflows/release.yml in the publish step; build matrix and artifact production paths remain unchanged.
if gh release view "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" >/dev/null 2>&1; then
  gh release upload "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" --clobber dist/*
else
  gh release create "${GITHUB_REF_NAME}" --repo "${GITHUB_REPOSITORY}" --title "${GITHUB_REF_NAME}" --generate-notes dist/*
fi

Co-authored-by: xylophoneengine <74956800+xylophoneengine@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job 'publish' Make release publish job idempotent when tag release already exists Sep 4, 2026
@xylophoneengine

Copy link
Copy Markdown
Owner

thank you

@xylophoneengine
xylophoneengine marked this pull request as ready for review September 4, 2026 08:09
@xylophoneengine
xylophoneengine merged commit 1be8f41 into master Sep 4, 2026
8 checks passed
@xylophoneengine
xylophoneengine deleted the copilot/fix-failing-publish-job branch September 4, 2026 08:09
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.

2 participants