Skip to content

Commit 117328a

Browse files
Grant contents: write to release job so gh-release can publish
The softprops/action-gh-release@v2 action needs write access to the repo's contents to create a release via the REST API. Since GitHub tightened the default GITHUB_TOKEN permissions in 2023, the token now arrives at each job with contents: read only. Scope contents: write to the release job; build-and-test keeps default read-only permissions. Fixes the 403 "Resource not accessible by integration" error that blocked the v1.0.0 release workflow. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4a5ac54 commit 117328a

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,15 @@ jobs:
5252
if: startsWith(github.ref, 'refs/tags/v')
5353
runs-on: windows-latest
5454

55+
# softprops/action-gh-release@v2 creates a GitHub Release for the
56+
# pushed tag via the REST API, which requires write access to the
57+
# repo's contents. The default GITHUB_TOKEN has read-only contents
58+
# since GitHub tightened action token defaults in 2023, so we have
59+
# to grant write explicitly here. Scoped to the release job only;
60+
# build-and-test stays on default read-only permissions.
61+
permissions:
62+
contents: write
63+
5564
steps:
5665
- name: Checkout
5766
uses: actions/checkout@v4

0 commit comments

Comments
 (0)