Skip to content

ci: make release workflow idempotent [4.x]#117

Merged
ManukMinasyan merged 1 commit into4.xfrom
fix/release-workflow-idempotent
Apr 28, 2026
Merged

ci: make release workflow idempotent [4.x]#117
ManukMinasyan merged 1 commit into4.xfrom
fix/release-workflow-idempotent

Conversation

@ManukMinasyan
Copy link
Copy Markdown
Contributor

Summary

The release workflow has been failing whenever a release is authored manually in the GitHub UI (or via gh release create locally). Manual release creation auto-creates the tag, which triggers release.yml, which then re-runs gh release create and fails with:

HTTP 422: Validation Failed
Release.tag_name already exists

Recent failures: v4.0.7, v4.0.8 (twice), v4.0.11. Runs that succeeded (v4.0.9, v4.0.10) were ones where only a tag was pushed and the workflow itself created the release.

Changes

  • Idempotent release creation — skip gh release create when a release for the tag already exists. Tests still run as a gate, so manually-published releases are still validated.
  • Drop redundant actions/checkout from both release and cleanup jobs. gh release create --generate-notes queries the GitHub API and doesn't need a local checkout; same for tag deletion.
  • Use gh api DELETE for cleanup instead of git push --delete. Removes the implicit dependency on having a working tree set up.

Test plan

  • Next release (manually authored or tag-only) does not fail this workflow.
  • When tests fail, the cleanup job successfully deletes the tag.

Previously the workflow failed with "Release.tag_name already exists"
when a release was authored manually (which auto-creates the tag and
triggers this workflow). Skip creation if the release already exists.

Also drop the now-unused checkout steps and use the GitHub API for tag
deletion in the cleanup job, which removes the need for a working tree.
Copilot AI review requested due to automatic review settings April 28, 2026 09:36
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Makes the 4.x release workflow idempotent so it no longer fails when a release is created manually (which auto-creates the tag and re-triggers the workflow). This keeps tests as the gate while avoiding a duplicate gh release create attempt and simplifying cleanup.

Changes:

  • Skip gh release create when a release for the pushed tag already exists (gh release view gate).
  • Remove redundant actions/checkout usage from release and cleanup jobs.
  • Replace git push --delete tag cleanup with gh api -X DELETE against the refs API.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ManukMinasyan ManukMinasyan merged commit 13c0851 into 4.x Apr 28, 2026
7 checks passed
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