fix(tooling): allow unsafe pulls from forks#725
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 74b24b36bf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ github.event.pull_request.head.sha }} | ||
| allow-unsafe-pr-checkout: true |
There was a problem hiding this comment.
Don't execute fork code in this privileged workflow
When a fork PR is given the validated label, this opts out of checkout's pull_request_target protection while the workflow has repo secrets in its top-level env and immediately runs the checked-out PR's yarn/lint scripts. GitHub's checkout docs say allow-unsafe-pr-checkout should be used only after confirming checked-out code is never executed (docs); here a malicious package script can exfiltrate the PW_* credentials. Run PR code under pull_request without secrets, or keep this privileged workflow on trusted/base code only.
Useful? React with 👍 / 👎.
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
bhabalan
left a comment
There was a problem hiding this comment.
Approving for now till we find a permanent fix
bhabalan
left a comment
There was a problem hiding this comment.
Approving for now till we find a permanent fix
mkesavan13
left a comment
There was a problem hiding this comment.
Approving for now. Need to work on long-term solution
|
✅ Your changes have been merged! Thank you for your contribution! 🤖 This is an automated message. For queries, please contact support. |
COMPLETES #N/A
This pull request addresses
The pull_request_target workflow was failing when checking out fork pull request code because actions/checkout now requires explicit opt-in for checking out PR head code in this trusted workflow context.
by making the following changes
Added allow-unsafe-pr-checkout: true to each actions/checkout@v6 step in .github/workflows/pull-request.yml that checks out github.event.pull_request.head.sha, while keeping persist-credentials: false in place.
Change Type
The following scenarios were tested
The GAI Coding Policy And Copyright Annotation Best Practices
I certified that
Make sure to have followed the contributing guidelines before submitting.