feat: add release branch check and auto tagging workflows#47
feat: add release branch check and auto tagging workflows#47pantharshit007 merged 3 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdds GitHub Actions: 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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
✅ Files skipped from review due to trivial changes (1)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
📒 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@v2for 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-baseto verify ancestry is the correct approach, and the PR comment provides clear resolution steps.
Description
#46
Added 2 new workflows
Summary by CodeRabbit
What type of PR is this? (check all applicable)
Mobile & Desktop Screenshots/Recordings