File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -121,6 +121,18 @@ paid trial until that prerequisite and its budget are separately authorized.
121121The execute job has read-only repository permissions, no publication token in
122122its model step, and checkout uses ` persist-credentials: false ` . The privileged
123123publisher 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+
124136The existing client's controlled skill exposure is not OS read confinement.
125137Plan artifacts contain files rather than empty directories. The adapter restores
126138each comparison's empty results directory after download; the existing executor
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments