Skip to content

Make Release workflow idempotent via softprops/action-gh-release#34

Closed
splch wants to merge 1 commit intomainfrom
fix/release-idempotent-gh-release
Closed

Make Release workflow idempotent via softprops/action-gh-release#34
splch wants to merge 1 commit intomainfrom
fix/release-idempotent-gh-release

Conversation

@splch
Copy link
Copy Markdown
Collaborator

@splch splch commented May 1, 2026

Summary

The github-release step in .github/workflows/release.yml calls gh release create directly, which returns HTTP 422 when a release already exists for the tag. This happens whenever a maintainer creates the release through the GitHub UI (or gh release create locally), since that flow creates the tag and the release in one shot - and the tag push then triggers this workflow, which tries to create the release a second time.

Both v0.1.0 (run 25136525282) and v0.1.1 (run 25227782847) hit this. PyPI publishing succeeded both times; only the final release-creation step failed, leaving the run red.

This PR swaps the raw gh release create for softprops/action-gh-release, which is idempotent: per its README, "if a tag already has a GitHub release, the existing release will be updated." Both flows (push-tag-only and create-release-in-UI) now end green.

The action talks to the GitHub API directly, so the actions/checkout step is no longer needed in this job and was removed.

Pinned to v3.0.0 SHA (b4309332981a82ec1c5618f44dd2e27cc8bfbfda) to match the repo's pinning convention; Dependabot's existing weekly github-actions group will keep it current.

Note: zizmor emits one informational superfluous-actions finding on the new step (it advises gh release is built into the runner). That's purely stylistic and does not fail CI - we accept it in exchange for idempotency, which the built-in gh release create does not provide.

Test plan

  • uvx zizmor .github/workflows/ shows only the one expected informational finding, no warnings/errors
  • Audit workflows job passes on this PR
  • On the next release tag, the github-release job succeeds whether the release already exists or not (verifiable on the next real release; can also be smoke-tested by re-running Release for v0.1.1 after merge - the existing release should be updated rather than recreated)

Important

Most code in ionq_core/ is auto-generated and overwritten on regeneration.
See CONTRIBUTING.md for which files are safe to edit.

The github-release step previously called `gh release create` directly,
which fails with HTTP 422 when a release already exists for the tag -
the case when a maintainer creates the release through the GitHub UI
(which also creates the tag and triggers this workflow). Both v0.1.0
and v0.1.1 hit this and reported red even though PyPI publish succeeded.

softprops/action-gh-release updates the existing release instead of
failing, so both flows (push-tag-only and create-release-in-UI) now
end green. The action talks to the API directly, so the checkout step
is no longer needed in this job.
@splch splch requested a review from a team as a code owner May 1, 2026 20:10
@splch
Copy link
Copy Markdown
Collaborator Author

splch commented May 1, 2026

Abandoning. The zizmor superfluous-actions rule fires on softprops/action-gh-release (informational, but the audit-workflows action treats any finding as failing), and silencing it via .github/zizmor.yml isn't worth the trade. Will revisit with a different approach.

@splch splch closed this May 1, 2026
@splch splch deleted the fix/release-idempotent-gh-release branch May 1, 2026 20:13
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.

1 participant