ci: clean up draft release on failed release runs#22
Merged
Conversation
Adds a cleanup-failed-release job to the tag release path. The draft-then-publish flow leaves a draft release if the upload matrix fails partway, since publish-release is then skipped. That draft is invisible to the public but lingers until removed by hand. This job runs only when a tag-triggered release run failed (if: failure() and ref is a v* tag) and needs the release-stage jobs so it does not fire on ordinary non-tag build failures. It deletes the draft release for the tag and the tag ref, so a partial release leaves nothing behind. It only deletes a draft (never a published release), is a no-op when nothing matches, and scopes contents: write to itself. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds cleanup-failed-release (needs create-release + upload-assets, if: failure() and v* tag). On a failed tag release run it deletes the draft release for the tag and the tag ref, so a partial release leaves nothing behind. Only deletes a draft (never published), no-op when nothing matches, contents: write scoped to the job. Validated: rc5 forced one upload leg to fail -> publish-release skipped, cleanup ran and removed the draft + tag; rc6 happy path published all 10 assets with cleanup skipped.
Made with Cursor