fix(ci): allow checkout@v7 fork PR checkout with environment gate#5365
fix(ci): allow checkout@v7 fork PR checkout with environment gate#5365rnetser wants to merge 1 commit into
Conversation
actions/checkout@v7 blocks fork PR checkouts in pull_request_target workflows by default. Add allow-unsafe-pr-checkout with an environment gate: org members run automatically, outside contributors require maintainer approval via the external-pr-tests environment. Signed-off-by: rnetser <rnetser@redhat.com> Co-authored-by: PI (claude-opus-4-6) <noreply@pi.dev> Signed-off-by: rnetser <rnetser@redhat.com>
|
Report bugs in Issues Welcome! 🎉This pull request will be automatically processed with the following features: 🔄 Automatic Actions
📋 Available CommandsPR Status Management
Review & Approval
Testing & Validation
Container Operations
Cherry-pick Operations
Branch Management
Label Management
✅ Merge RequirementsThis PR will be automatically approved when the following conditions are met:
📊 Review ProcessApprovers and ReviewersApprovers:
Reviewers:
Available Labels
AI Features
Security Checks
💡 Tips
For more information, please refer to the project documentation or contact the maintainers. |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThe ChangesUtilities Unit Tests Workflow — PR Environment Gating
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Caution Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional.
❌ Failed checks (1 error)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsLinked repositories: Your configuration references 1 linked repositories, but your current plan allows 0. Analyzed ``, skipped 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 |
|
Opened in error — closing. |
What this PR does / why we need it:
actions/checkout@v7(bumped in #5289) blocks fork PR checkouts inpull_request_targetworkflows by default to prevent "pwn request" attacks. This broke theutilities-unit-testsworkflow for all fork PRs (e.g. #5355).Fix: Add
allow-unsafe-pr-checkout: truewith an environment-based gate:COLLABORATOR/MEMBER/OWNER) → run automatically (no environment)external-pr-testsenvironmentNote: The
external-pr-testsenvironment must be created in repo Settings → Environments with "Required reviewers" enabled for the gate to work. Without it, outside contributor PRs will fail with "environment not found".Which issue(s) this PR fixes:
Fixes the
Run Utilities Unit Testscheck failure on fork PRs after checkout@v7 upgrade.Special notes for reviewer:
allow-unsafe-pr-checkout: truealone would be safe. The environment gate adds a second layer of defense.v6had the same behavior (checked out fork code silently) —v7just made it explicit.jira-ticket:
Summary by CodeRabbit