Skip to content

Commit 7562be7

Browse files
authored
Merge pull request #63 from mbel-tech/fix/release-publish-permissions
fix(release): grant the publish job contents:write
2 parents 391e01c + 297aa6a commit 7562be7

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎.github/workflows/release.yml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,15 @@ on:
1111
tags: ["v*"]
1212
workflow_dispatch:
1313

14+
# This repository's default GITHUB_TOKEN permission is read-only, so the
15+
# publish job has to ask for write access explicitly -- without it,
16+
# `gh release create` fails with "HTTP 403: Resource not accessible by
17+
# integration". Declared here rather than by flipping the repository-wide
18+
# default to read/write, which would hand every job in every workflow more
19+
# access than it needs. Build jobs only ever read.
20+
permissions:
21+
contents: read
22+
1423
jobs:
1524
build:
1625
name: Build (${{ matrix.os }})
@@ -255,6 +264,10 @@ jobs:
255264
needs: [build, determinism]
256265
if: startsWith(github.ref, 'refs/tags/v')
257266
runs-on: ubuntu-22.04
267+
# Creating a release writes to the repository; this is the only job
268+
# that needs more than the workflow-level read above.
269+
permissions:
270+
contents: write
258271
steps:
259272
- uses: actions/download-artifact@v4
260273
with:

0 commit comments

Comments
 (0)