feat: Add nightly cleanup of stale draft releases#2239
Merged
charlesvien merged 2 commits intoMay 20, 2026
Conversation
Member
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Contributor
Prompt To Fix All With AIFix the following 2 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 2
.github/workflows/cleanup-draft-releases.yml:22-23
Without `set -o pipefail`, if `gh api --paginate` fails (e.g., auth error, rate limit, network issue), bash reports the exit status of the last command in the pipeline — the `while` loop — which exits 0 on empty input. The step passes silently with no releases deleted and no error surfaced, making failures completely invisible in CI logs.
```suggestion
run: |
set -o pipefail
CUTOFF=$(date -u -d "1 hour ago" +%Y-%m-%dT%H:%M:%SZ)
```
### Issue 2 of 2
.github/workflows/cleanup-draft-releases.yml:18-23
**1-hour cutoff can delete in-progress release drafts**
The `code-release.yml` workflow builds macOS and Windows packages in parallel, each of which can take 30–60+ minutes before `finalize-release` un-drafts the release. When this cleanup is triggered via `workflow_dispatch` at e.g. 1:15 AM UTC and a release started at midnight, the draft would be ~1 hr 15 min old and fall inside the deletion window, mid-build. Consider raising the threshold to something like 24 hours (or at least 3–4 hours) since the scheduled run is daily anyway, which removes the risk without any real downside for stale-draft cleanup.
Reviews (1): Last reviewed commit: "Add nightly cleanup of stale draft relea..." | Re-trigger Greptile |
1623d47 to
a29daf7
Compare
Contributor
pog |
adboio
approved these changes
May 20, 2026
a29daf7 to
070c9bf
Compare
This was referenced May 20, 2026
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.

Problem
Draft releases left behind by failed or aborted release runs accumulate over time and clutter the releases page.
Changes
How did you test this?
I did not
Publish to changelog?