Skip to content

ci: fix tag deletions#1323

Merged
doodlum merged 2 commits into
community-shaders:devfrom
alandtse:ci_pr_cleanup
Jul 28, 2025
Merged

ci: fix tag deletions#1323
doodlum merged 2 commits into
community-shaders:devfrom
alandtse:ci_pr_cleanup

Conversation

@alandtse
Copy link
Copy Markdown
Collaborator

@alandtse alandtse commented Jul 28, 2025

Summary by CodeRabbit

  • New Features

    • Added a dry run option to the pre-release cleanup workflow, allowing users to preview which tags and releases would be deleted without making any changes.
  • Chores

    • Improved summary reporting for cleanup actions, providing detailed lists of items to be deleted or kept, along with reasons and relevant links.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 28, 2025

Walkthrough

The GitHub Actions workflow for cleaning up pre-release tags and releases now supports a dry_run option, enabling users to preview deletions without executing them. The script distinguishes between PR-related and other pre-release tags, checks their status, and conditionally deletes or retains them, providing detailed summaries for both dry-run and actual deletion modes.

Changes

Cohort / File(s) Change Summary
Pre-release Cleanup Workflow
.github/workflows/cleanup-pre-releases.yaml
Added dry_run input for manual runs; script now supports previewing deletions, improved tag/release evaluation logic, and enhanced summary output.

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
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Suggested reviewers

  • doodlum

Poem

A bunny with a broom, so spry,
Now sweeps pre-releases—oh my!
With dry-run in paw,
It checks without flaw,
And hops off, not a single tag awry.
🐇✨


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 68f6b08 and 29b6a43.

📒 Files selected for processing (1)
  • .github/workflows/cleanup-pre-releases.yaml (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/cleanup-pre-releases.yaml
✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
.github/workflows/cleanup-pre-releases.yaml (2)

33-42: Harden the script with set -euo pipefail

A single silent failure (e.g., network hiccup during git fetch or gh calls) 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/checkout defaults to a shallow clone (depth = 1). Although you later run git 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
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 658eae7 and 68f6b08.

📒 Files selected for processing (1)
  • .github/workflows/cleanup-pre-releases.yaml (4 hunks)

Comment thread .github/workflows/cleanup-pre-releases.yaml Outdated
Comment thread .github/workflows/cleanup-pre-releases.yaml
@doodlum doodlum merged commit 0d1edc3 into community-shaders:dev Jul 28, 2025
6 checks passed
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.

2 participants