🌱 Fix changelog fragment check for fork PRs#49
Conversation
|
Warning Review limit reached
Next review available in: 50 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe changelog workflow now checks out the base repository, fetches the pull request head into ChangesChangelog verification
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
f1ba436 to
17c93b5
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/pr-checks.yml:
- Around line 29-31: Update the actions/checkout@v4 step to set
persist-credentials to false alongside fetch-depth, ensuring the privileged
token is not retained in local Git configuration while preserving the
full-history checkout.
- Around line 34-36: Update the “Check for changelog fragment” step to read the
pull request base ref through a dedicated environment variable rather than
interpolating the GitHub context directly in the shell command. Add the
`:!changes/unreleased/template.yaml` exclusion to the git diff pathspecs so the
fragment list matches the downstream changelog discovery behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 106cb44e-b061-4eb4-a3ad-47e251d7aad8
📒 Files selected for processing (1)
.github/workflows/pr-checks.yml
actions/checkout refuses to check out fork PR head commits in pull_request_target workflows, so the 'Verify changelog fragment' job failed for every fork PR. Check out the base repo instead and fetch the PR head as a plain ref for the diff — PR code is never checked out. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: ibolton336 <ibolton@redhat.com>
17c93b5 to
2164d7c
Compare
Fixes #48.
The
changelogjob runs underpull_request_targetand checked outgithub.event.pull_request.head.sha, which actions/checkout now refuses for fork PRs ("Refusing to check out fork pull request code from a 'pull_request_target' workflow"). Every fork PR of type feature/bugfix/breaking failed the check — e.g. this run on PR #35.Since the job only diffs file names and never executes PR code, this checks out the base repo and fetches the PR head as a plain ref (
git fetch origin pull/<n>/head:pr-head), then diffsorigin/<base>...pr-head. Fork code is never checked out into the workspace, so noallow-unsafe-pr-checkout: trueescape hatch is needed and the workflow keeps its safety guarantees.Verification: YAML validated; the diff expression is unchanged apart from
HEAD→pr-head. The fix itself can only be fully exercised by a fork PR against a repo where this workflow already runs on main (pull_request_target uses the base branch's workflow definition), so the real proof will be the next fork PR after this merges.🤖 Generated with Claude Code
Summary by CodeRabbit