Skip to content

Commit 0c36ca9

Browse files
authored
Fix PR verification agent: grant contents:write to push verification branches (#141)
1 parent 9bdc0b2 commit 0c36ca9

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

.github/workflows/pr-verification.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
name: 🔎 PR Verification Agent
22

3-
# Security: This workflow has write permissions to issues and PRs, so it must NOT
4-
# use the `pull_request` trigger (which checks out untrusted PR code and could
5-
# exfiltrate the job token). Instead, it runs on schedule/manual dispatch only.
6-
# The agent fetches each PR's branch itself before building and verifying.
3+
# Security: This workflow has write permissions to contents, issues, and PRs, so
4+
# it must NOT use the `pull_request` trigger (which checks out untrusted PR code
5+
# and could exfiltrate the job token). Instead, it runs on schedule/manual
6+
# dispatch only. The agent fetches each PR's branch itself before building and
7+
# verifying. The contents:write permission is needed to push verification sample
8+
# code to verification/pr-<N> branches.
79
on:
810
# Run periodically to pick up PRs labeled pending-verification
911
schedule:
@@ -13,7 +15,7 @@ on:
1315
workflow_dispatch:
1416

1517
permissions:
16-
contents: read
18+
contents: write
1719
issues: write
1820
pull-requests: write
1921

@@ -35,7 +37,6 @@ jobs:
3537
uses: actions/checkout@v4
3638
with:
3739
fetch-depth: 0
38-
persist-credentials: false
3940

4041
- name: ⚙️ Setup Node.js
4142
uses: actions/setup-node@v4

0 commit comments

Comments
 (0)