ci: fix tag deletions#1323
Conversation
WalkthroughThe GitHub Actions workflow for cleaning up pre-release tags and releases now supports a Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant GitHub Actions
participant Script
participant GitHub API
User->>GitHub Actions: Trigger workflow (optionally with dry_run)
GitHub Actions->>Script: Run cleanup script with dry_run param
Script->>GitHub API: Fetch pre-release releases and tags
Script->>GitHub API: For PR tags, check PR state/draft status
Script->>GitHub API: For other tags, check for corresponding final release
alt dry_run enabled
Script->>GitHub Actions: Output tags to delete/keep (no deletions)
else actual deletion
Script->>GitHub API: Delete releases/tags as needed
Script->>GitHub Actions: Output summary of deletions
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (2)
.github/workflows/cleanup-pre-releases.yaml (2)
33-42: Harden the script withset -euo pipefailA single silent failure (e.g., network hiccup during
git fetchorghcalls) will currently go unnoticed and may leave the repo in an inconsistent state. Add the standard safety flags right after defining the shebang block:# Set dry run mode DRY_RUN="${{ inputs.dry_run || 'false' }}" + # Fail fast and surface unexpected issues + set -euo pipefail + if [[ "$DRY_RUN" == "true" ]]; then
24-28: Fetch full history to guarantee tag availability
actions/checkoutdefaults to a shallow clone (depth = 1). Although you later rungit fetch --tags, a shallow clone can still cause missing/tag issues on some Git versions. Fetch full history upfront:with: ref: ${{ github.event.repository.default_branch }} + fetch-depth: 0 # ensure subsequent git commands can see all refs
Summary by CodeRabbit
New Features
Chores