Skip to content

ci: harden releases against branch/tag name collisions#432

Open
ng wants to merge 1 commit intodevfrom
chore/release-tag-collision-guard
Open

ci: harden releases against branch/tag name collisions#432
ng wants to merge 1 commit intodevfrom
chore/release-tag-collision-guard

Conversation

@ng
Copy link
Copy Markdown
Contributor

@ng ng commented Apr 14, 2026

Summary

Defense-in-depth follow-up to #427 (rolling dev tag rename). Two additions so the same shape of bug — a tag name colliding with a branch name, which made git fetch --tags fail and silently blocked every versioned release on main — can't silently recur.

  • release.yml: run git fetch --tags --force --prune --prune-tags origin before semantic-release. semantic-release itself runs git fetch --tags unconditionally and aborts on any "would clobber existing tag" conflict, so force-pruning up front means a stray colliding tag recovers instead of blocking the release.
  • ref-collision-check.yml (new): runs on push to main / dev, fails CI if any branch and tag share a name. Loud early signal instead of a silently-missing GitHub Release.

Neither change touches dev-release.yml#427 already fixed the original collision by renaming the rolling tag to dev-latest, and v1.6.0 cut cleanly on 2026-04-13 with the tarball attached.

Test plan

  • Merge; confirm the new Ref Collision Check job runs green on dev and main
  • On the next devmain merge, confirm Analyze & Release completes git fetch --tags --force and cuts a new versioned release
  • (Optional manual test) push a tag named dev to a scratch branch; confirm Ref Collision Check fails with the offending name

Summary by CodeRabbit

  • Chores
    • Added automatic validation to detect branch and tag name collisions in the CI/CD pipeline.
    • Enhanced release workflow with improved tag synchronization to ensure clean release processes.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 14, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f270dc3a-5876-41f1-9352-cebebdc5b859

📥 Commits

Reviewing files that changed from the base of the PR and between 5fc3a7f and 34322c5.

📒 Files selected for processing (2)
  • .github/workflows/ref-collision-check.yml
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

Two GitHub Actions workflows are added/modified: a new collision detection workflow checks for naming conflicts between branches and tags on main/dev branches, while the release workflow now synchronizes remote tags before running semantic-release to prevent stale tag issues.

Changes

Cohort / File(s) Summary
New Collision Detection Workflow
.github/workflows/ref-collision-check.yml
New workflow that detects and reports any collisions between branch and tag names, failing the workflow if conflicts are found.
Release Workflow Enhancement
.github/workflows/release.yml
Adds tag synchronization step (git fetch --tags --force --prune --prune-tags origin) before semantic-release execution to ensure local tags are consistent with remote state.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

released

Poem

🐰 A rabbit hops through branches and tags,
Checking for collisions, avoiding the snags,
With git synced clean before release day,
No stale tags to lead us astray! 🏷️✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding hardening against branch/tag name collisions in CI workflows.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/release-tag-collision-guard

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

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

1 participant