Skip to content

Commit eeebf3b

Browse files
authored
fix: add pull-requests: write permission to merge-to-main job (#213)
The `merge-to-main` job was failing because `GITHUB_TOKEN` lacked `pull-requests: write`, causing `gh pr create` to be rejected with `GraphQL: Resource not accessible by integration (createPullRequest)`. ## Change - Added job-level `permissions` block to `merge-to-main` with `pull-requests: write` and `contents: read`, scoped only to the job that needs it rather than elevating the entire workflow. ```yaml merge-to-main: ... permissions: pull-requests: write contents: read ```
1 parent c83fc81 commit eeebf3b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ jobs:
277277
needs: [workflow-variables, release, versioning]
278278
if: ${{ needs.workflow-variables.outputs.is-release == 'true' }}
279279
runs-on: ubuntu-latest
280+
permissions:
281+
pull-requests: write
282+
contents: read
280283
env:
281284
GH_TOKEN: ${{ github.token }}
282285
current-branch: ${{ github.ref_name }}

0 commit comments

Comments
 (0)