Skip to content

Commit 433a2db

Browse files
committed
fix: grant publisher write access to PR comments
Agent-assisted-by: Codex (author) Signed-off-by: GUOGUO <xwdong1998@163.com>
1 parent 3069b6d commit 433a2db

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

‎.github/workflows/skill-eval-pr.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ jobs:
134134
permissions:
135135
contents: read
136136
actions: read
137-
pull-requests: read
137+
pull-requests: write
138138
issues: write
139139
steps:
140140
- uses: actions/checkout@v4

‎docs/skill-eval-pr.md‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,18 @@ paid trial until that prerequisite and its budget are separately authorized.
121121
The execute job has read-only repository permissions, no publication token in
122122
its model step, and checkout uses `persist-credentials: false`. The privileged
123123
publisher is a separate fresh job. Model access must not also grant PR publishing.
124+
Only the publish job requests `pull-requests: write`, alongside its existing
125+
`issues: write`; planning and execution retain read-only repository permissions.
126+
In the controlled fork [baseline](https://github.com/Dong1017/OmniRSI/actions/runs/40455073055),
127+
the same Actions job could create/update an ordinary Issue comment but received
128+
permission HTTP403 for a PR conversation comment with PullRequests read.
129+
The owner-approved [contrast](https://github.com/Dong1017/OmniRSI/actions/runs/40460346043)
130+
verified PR comment creation/update with PullRequests write, preserving the HTTP
131+
client and other grants. The [result and restoration record](https://github.com/Dong1017/OmniRSI/issues/3#issuecomment-6435261413)
132+
covers that fork push context; upstream recovery still needs a successful
133+
publication receipt from the merged trusted workflow. Advertised endpoint
134+
permission alternatives alone do not prove effective authorization.
135+
124136
The existing client's controlled skill exposure is not OS read confinement.
125137
Plan artifacts contain files rather than empty directories. The adapter restores
126138
each comparison's empty results directory after download; the existing executor

‎tests/test_skill_eval_pr.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,13 @@ def test_workflow_separates_execution_and_publication_credentials():
451451
workflow = yaml.safe_load((ROOT / integration.WORKFLOW).read_text(encoding="utf-8"))
452452
assert workflow["concurrency"]["cancel-in-progress"] is False
453453
executor = workflow["jobs"]["execute"]
454-
assert all(value != "write" for value in executor["permissions"].values())
455-
assert workflow["jobs"]["publish"]["permissions"]["issues"] == "write"
454+
readers = {"contents": "read", "actions": "read", "pull-requests": "read"}
455+
assert workflow["permissions"] == {}
456+
assert workflow["jobs"]["plan"]["permissions"] == readers
457+
assert executor["permissions"] == readers
458+
# PR conversation writes belong only to the separate trusted publisher.
459+
assert workflow["jobs"]["publish"]["permissions"] == {
460+
**readers, "pull-requests": "write", "issues": "write"}
456461
for job in workflow["jobs"].values():
457462
checkout = next(step for step in job["steps"] if step.get("uses") == "actions/checkout@v4")
458463
assert checkout["with"]["persist-credentials"] is False

0 commit comments

Comments
 (0)