Conversation
Skip changeset check when PR base is staging or main. Promotion PRs already contain changesets from individual feature PRs.
chore: promote dev → staging (CI changeset exemption fix)
WalkthroughA new changeset exemption file was added for the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/changeset.yml:
- Around line 16-19: The current conditional using
github.event.pull_request.base.ref incorrectly skips the job for any PR
targeting 'staging' or 'main'; change the logic so the job is skipped only for
genuine promotion automation PRs by combining the base ref check with an
automation indicator such as github.actor or the PR author (e.g.
github.event.pull_request.user.login) or a promotion-specific head ref/label
(e.g. github.event.pull_request.head.ref startsWith 'promote/' or presence of a
'promotion' label). Update the if expression to require both
github.event.pull_request.base.ref == 'staging' || 'main' AND (github.actor ==
'<bot-name>' OR github.event.pull_request.user.login == '<bot-name>' OR
github.event.pull_request.head.ref matches the promotion pattern OR the PR has
the promotion label) so only bot/automation promotion PRs bypass the changeset
check.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: 45f08808-0115-4541-a13c-6dfdf2be82ba
📒 Files selected for processing (2)
.changeset/ci-changeset-exemption.md.github/workflows/changeset.yml
| # Skip changeset check on promotion PRs (dev→staging, staging→main) | ||
| if: | | ||
| github.event.pull_request.base.ref != 'staging' && | ||
| github.event.pull_request.base.ref != 'main' |
There was a problem hiding this comment.
Condition is too broad and bypasses checks on all main/staging PRs.
At Line [17]-Line [19], this skips the job for any PR targeting main or staging, not only promotion/bot PRs. That weakens enforcement for non-promotion PRs to those branches.
Suggested narrowing of the exemption logic
- # Skip changeset check on promotion PRs (dev→staging, staging→main)
- if: |
- github.event.pull_request.base.ref != 'staging' &&
- github.event.pull_request.base.ref != 'main'
+ # Skip only known promotion and release-bot PRs
+ if: |
+ !(
+ (github.event.pull_request.base.ref == 'staging' && github.event.pull_request.head.ref == 'dev') ||
+ (github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref == 'staging') ||
+ startsWith(github.event.pull_request.head.ref, 'changeset-release/')
+ )📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| # Skip changeset check on promotion PRs (dev→staging, staging→main) | |
| if: | | |
| github.event.pull_request.base.ref != 'staging' && | |
| github.event.pull_request.base.ref != 'main' | |
| # Skip only known promotion and release-bot PRs | |
| if: | | |
| !( | |
| (github.event.pull_request.base.ref == 'staging' && github.event.pull_request.head.ref == 'dev') || | |
| (github.event.pull_request.base.ref == 'main' && github.event.pull_request.head.ref == 'staging') || | |
| startsWith(github.event.pull_request.head.ref, 'changeset-release/') | |
| ) |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/changeset.yml around lines 16 - 19, The current
conditional using github.event.pull_request.base.ref incorrectly skips the job
for any PR targeting 'staging' or 'main'; change the logic so the job is skipped
only for genuine promotion automation PRs by combining the base ref check with
an automation indicator such as github.actor or the PR author (e.g.
github.event.pull_request.user.login) or a promotion-specific head ref/label
(e.g. github.event.pull_request.head.ref startsWith 'promote/' or presence of a
'promotion' label). Update the if expression to require both
github.event.pull_request.base.ref == 'staging' || 'main' AND (github.actor ==
'<bot-name>' OR github.event.pull_request.user.login == '<bot-name>' OR
github.event.pull_request.head.ref matches the promotion pattern OR the PR has
the promotion label) so only bot/automation promotion PRs bypass the changeset
check.
Summary
Test plan
Summary by CodeRabbit