Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
allow-unsafe-pr-checkout: true

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

persist-credentials: false

- name: Setup Node
Expand Down Expand Up @@ -145,6 +146,7 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
allow-unsafe-pr-checkout: true
persist-credentials: false

- name: Setup Node
Expand Down Expand Up @@ -198,6 +200,7 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
allow-unsafe-pr-checkout: true
persist-credentials: false

- name: Setup Node
Expand Down Expand Up @@ -251,6 +254,7 @@ jobs:
uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.sha }}
allow-unsafe-pr-checkout: true
persist-credentials: false

- name: Setup Node
Expand Down
Loading