Skip to content

🌱 Fix changelog fragment check for fork PRs#49

Merged
djzager merged 1 commit into
konveyor:mainfrom
ibolton336:fix/changelog-fork-prs
Jul 21, 2026
Merged

🌱 Fix changelog fragment check for fork PRs#49
djzager merged 1 commit into
konveyor:mainfrom
ibolton336:fix/changelog-fork-prs

Conversation

@ibolton336

@ibolton336 ibolton336 commented Jul 20, 2026

Copy link
Copy Markdown
Member

Fixes #48.

The changelog job runs under pull_request_target and checked out github.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 diffs origin/<base>...pr-head. Fork code is never checked out into the workspace, so no allow-unsafe-pr-checkout: true escape hatch is needed and the workflow keeps its safety guarantees.

Verification: YAML validated; the diff expression is unchanged apart from HEADpr-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

  • Chores
    • Improved pull request checks for changelog fragments.
    • Changelog verification now more reliably compares proposed changes with the target branch.
    • Updated validation behavior helps ensure checks run consistently without affecting the application experience.

@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ibolton336, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 50 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6ba7a8b1-2a9d-450f-a6d2-25d5f9dacc71

📥 Commits

Reviewing files that changed from the base of the PR and between 17c93b5 and 2164d7c.

📒 Files selected for processing (1)
  • .github/workflows/pr-checks.yml
📝 Walkthrough

Walkthrough

The changelog workflow now checks out the base repository, fetches the pull request head into pr-head, and compares that ref with the base branch when verifying changelog fragments.

Changes

Changelog verification

Layer / File(s) Summary
Fetch and diff pull request ref
.github/workflows/pr-checks.yml
The changelog job fetches the pull request head as pr-head and uses it in the base-to-head diff without checking out fork code.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main workflow fix for fork PR changelog checks.
Description check ✅ Passed The description explains the bug, the fix, and verification, and it fits the repository's template requirements.
Linked Issues check ✅ Passed The workflow changes match issue #48 by avoiding fork checkout, fetching the PR head as a ref, and diffing against it.
Out of Scope Changes check ✅ Passed The pull request appears scoped to the changelog workflow fix with no unrelated changes introduced.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@ibolton336
ibolton336 force-pushed the fix/changelog-fork-prs branch 2 times, most recently from f1ba436 to 17c93b5 Compare July 20, 2026 19:35

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0fbaaba and 17c93b5.

📒 Files selected for processing (1)
  • .github/workflows/pr-checks.yml

Comment thread .github/workflows/pr-checks.yml
Comment thread .github/workflows/pr-checks.yml Outdated
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>
@ibolton336
ibolton336 force-pushed the fix/changelog-fork-prs branch from 17c93b5 to 2164d7c Compare July 20, 2026 19:45
@djzager
djzager merged commit b344014 into konveyor:main Jul 21, 2026
7 of 8 checks passed
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.

"Verify changelog fragment" job fails for all fork PRs (checkout refuses fork head under pull_request_target)

2 participants