Add script to delete automated GitHub releases while preserving tags#6683
Add script to delete automated GitHub releases while preserving tags#6683masenf wants to merge 2 commits into
Conversation
Add scripts/delete_automated_releases.sh, which finds every GitHub Release whose body starts with "Automated release for" or "Dispatch release for" (the markers emitted by the automated/dispatch release CI workflows) and deletes the Release entries via the gh CLI, leaving the underlying git tags intact (it never passes `gh release delete --cleanup-tag`). The script enumerates releases dynamically with `gh api --paginate`, defaults to a dry run that only lists matches, requires --apply (plus a confirmation prompt unless --yes) to delete, and backs up the matching release objects to JSON before deleting. The backup file is gitignored. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GuovjAVb7evQGBXY7ZRkXx
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: acb590e7cb
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| # Body prefixes that identify an auto-generated release. Matching is exact | ||
| # (no leading-whitespace tolerance). Add/remove entries here to adjust scope. | ||
| PREFIXES=("Automated release for" "Dispatch release for") |
There was a problem hiding this comment.
Preserve top-level dispatch releases
When this cleanup is run with --apply, matching the broad Dispatch release for prefix also selects top-level Reflex releases: .github/scripts/dispatch_release/create_release.sh writes that prefix for every dispatch release, and the dispatch planner appends a package: "reflex" release with a v... tag whenever reflex-base is released; those Reflex releases are the only dispatch releases not forced to --latest=false. Please exclude the reflex/v... dispatch releases or otherwise restrict this matcher to the sub-package releases intended to be removed, otherwise the script will delete the main GitHub Release entries from the Releases page.
Useful? React with 👍 / 👎.
Merging this PR will not alter performance
Comparing Footnotes
|
Greptile SummaryThis PR adds
Confidence Score: 5/5Safe to merge — the script is a dry-run-by-default maintenance utility that operates only on GitHub Release metadata and never touches git tags. The change introduces a standalone maintenance script that deletes GitHub Release UI entries without touching git tags. The logic is well-guarded with set -euo pipefail, dry-run default, timestamped backups, and a confirmation prompt. No existing application code is modified. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "Preserve top-level non-prerelease releas..." | Re-trigger Greptile |
Restrict the deletion scope so the script never removes top-level reflex releases (the main package's bare "vX.Y.Z" tags) unless they are pre-releases. The "Dispatch release for" prefix matches the main package's release entries too (the dispatch planner appends a `package: "reflex"` release whenever reflex-base is released, and those are the only dispatch releases not marked --latest=false), so the previous filter would have removed finalized core entries like v0.9.5 from the Releases page. Top-level alpha pre-releases (e.g. v0.9.4a1) and all sub-package releases remain in scope. Also address two review nits: - Timestamp the backup filename so retrying after a partial failure no longer clobbers an earlier run's backup (gitignore glob still matches). - Print a note when --yes is passed without --apply, which is otherwise a silent no-op. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GuovjAVb7evQGBXY7ZRkXx
Type of change
Description
This PR adds a utility script (
scripts/delete_automated_releases.sh) to clean up automatically-generated GitHub Releases while preserving their underlying git tags.Problem: The automated and dispatch release CI workflows create one Release entry per sub-package version bump, cluttering the Releases page.
Solution: The new script identifies and deletes Release objects whose body starts with "Automated release for" or "Dispatch release for", while keeping the git tags intact (by never passing
--cleanup-tagtogh release delete). This preserves pip installs, changelog links, and other references that depend on the tags.Features:
--applyflag to enable deletion with confirmation prompt--yesflag to skip confirmation--repoflag to target a different repositoryghCLI andjq; validates authentication and tool availabilityChanges:
scripts/delete_automated_releases.shwith comprehensive documentation and error handling.gitignoreto exclude backup files created by the scriptTesting
No testing needed — this is a utility script for repository maintenance. The script includes built-in validation (checks for required tools, authentication, and provides dry-run mode for safe preview).
Checklist
https://claude.ai/code/session_01GuovjAVb7evQGBXY7ZRkXx