Skip to content

feat: add release branch check and auto tagging workflows#47

Merged
pantharshit007 merged 3 commits intomainfrom
feat/prod-workflow
Oct 26, 2025
Merged

feat: add release branch check and auto tagging workflows#47
pantharshit007 merged 3 commits intomainfrom
feat/prod-workflow

Conversation

@pantharshit007
Copy link
Owner

@pantharshit007 pantharshit007 commented Oct 25, 2025

Description

#46

Added 2 new workflows

Summary by CodeRabbit

  • Chores
    • Added an automated tagging and release workflow to create version tags and GitHub releases on prod pushes (skips if tag exists).
    • Added pre-release checks to validate PR source and ensure prod and main are synchronized, posting remediation guidance when out of sync.
    • Added a sample event fixture to support the workflow checks and bumped the package version.

What type of PR is this? (check all applicable)

  • 🍕 New Component
  • 🐛 Bug Fix
  • 📝 Documentation Update
  • 🎨 Style
  • 🧑‍💻 Code Refactor
  • 🔥 Performance Improvements

Mobile & Desktop Screenshots/Recordings

@vercel
Copy link

vercel bot commented Oct 25, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
aether-ui Ready Ready Preview Comment Oct 25, 2025 9:07pm

@coderabbitai
Copy link

coderabbitai bot commented Oct 25, 2025

Walkthrough

Adds GitHub Actions: release-check.yml (validates PRs to prod come from main and ensures prod is an ancestor of main) and release-tag.yml (reads version from package.json, creates/pushes vX.Y.Z tag and GitHub release on prod pushes). Adds event.json fixture and bumps package version.

Changes

Cohort / File(s) Summary
Release PR validation
.github/workflows/release-check.yml
New workflow triggered on pull_request to prod. Verifies PR head is main; fetches branches and checks whether prod is an ancestor of main. Posts a remediation PR comment and fails if not in sync; otherwise sets sync status to ok.
Auto tagging & release
.github/workflows/release-tag.yml
New workflow triggered on push to prod. Reads version from package.json, computes tag vX.Y.Z; if tag exists it skips, otherwise creates & pushes tag and creates a GitHub release using softprops/action-gh-release.
Test event fixture
event.json
Adds a minimal pull_request event fixture with head.ref "main" and base.ref "prod".
Version bump
package.json
Bumps package version from 0.1.5 to 0.1.6. No other functional changes.

Sequence Diagram(s)

sequenceDiagram
    actor Developer
    Developer->>GitHub: Open PR (head: main → base: prod)

    rect rgb(230,245,255)
    Note over GitHub,Runner: release-check.yml (on pull_request to prod)
    GitHub->>Runner: Trigger workflow
    Runner->>Runner: Check PR head == "main"
    alt head != "main"
        Runner->>GitHub: Fail job (error)
    else head == "main"
        Runner->>Git: Fetch branches
        Runner->>Git: git merge-base --is-ancestor prod main
        alt prod is not ancestor of main
            Runner->>GitHub: Post PR comment with sync remediation
            Runner->>GitHub: Fail job
        else prod is ancestor
            Runner->>GitHub: Log success / set sync_status ok
        end
    end
    end

    rect rgb(240,255,240)
    Note over GitHub,Runner: release-tag.yml (on push to prod)
    GitHub->>Runner: Trigger workflow
    Runner->>Runner: Read version from package.json -> tag vX.Y.Z
    Runner->>GitHub: Check tag existence
    alt tag exists
        Runner->>GitHub: Skip tagging
    else tag missing
        Runner->>Git: Create & push tag vX.Y.Z
        Runner->>GitHub: Create GitHub release for tag
    end
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Review .github/workflows/release-check.yml Git commands, exit codes, and PR comment content.
  • Verify permissions/secrets and concurrency/race handling in .github/workflows/release-tag.yml when creating/pushing tags and creating releases.
  • Confirm package.json version bump is intentional and consistent with tagging logic.

Poem

🐰 I hopped through CI with a curious grin,
Checked branches and tags with a twitch of my chin.
When prod and main dance in orderly rows,
A vX.Y.Z blossom and a release gate glows.
Hop, tag, release — into the meadow we go! 🚀

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The PR title "feat: add release branch check and auto tagging workflows" directly and accurately summarizes the primary changes in the changeset. The title specifically references the two main workflow additions: release-check.yml (which implements the release branch check functionality) and release-tag.yml (which implements the auto-tagging functionality). The title is concise, clear, uses proper conventional commit formatting with the "feat:" prefix, and is specific enough for a developer scanning PR history to understand the purpose of this changeset. While the PR also includes a minor version bump and test file, these are ancillary changes and not expected to be captured in the title.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/prod-workflow

📜 Recent review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3b365cc and 4c7f571.

📒 Files selected for processing (1)
  • package.json (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • package.json

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.

Copy link

@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: 1

📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 716c322 and 81e649d.

📒 Files selected for processing (3)
  • .github/workflows/release-check.yml (1 hunks)
  • .github/workflows/release-tag.yml (1 hunks)
  • event.json (1 hunks)
🧰 Additional context used
🪛 actionlint (1.7.8)
.github/workflows/release-check.yml

14-14: "github.head_ref" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/reference/security/secure-use#good-practices-for-mitigating-script-injection-attacks for more details

(expression)

🔇 Additional comments (3)
event.json (1)

1-10: LGTM!

The test event file correctly represents a PR from main to prod, aligning with the release workflows' expectations.

.github/workflows/release-tag.yml (1)

1-62: LGTM!

The tagging workflow is well-structured with proper conditional logic. The idempotent tag existence check prevents duplicate releases, and the release creation includes useful metadata (version, commit SHA). The use of softprops/action-gh-release@v2 for release management is a solid choice.

.github/workflows/release-check.yml (1)

25-77: Branch sync verification logic is sound.

The two-job design effectively enforces release gate controls: the first job validates source, and the second verifies synchronization with helpful remediation guidance. The use of git merge-base to verify ancestry is the correct approach, and the PR comment provides clear resolution steps.

@pantharshit007 pantharshit007 merged commit ea568fb into main Oct 26, 2025
4 checks passed
pantharshit007 added a commit that referenced this pull request Oct 26, 2025
@pantharshit007 pantharshit007 deleted the feat/prod-workflow branch October 31, 2025 09:22
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