Skip to content

Commit ac7ea5f

Browse files
committed
ci: scope workflow token permissions
Set the CI workflow default GITHUB_TOKEN permissions to read-all so most jobs run with read-only access. Grant artifact metadata write only to the native package build job that uploads artifacts, and grant artifact/action read access only to the publish dry-run job that downloads those artifacts. This keeps the docs-only gating workflow least-privilege while preserving the artifact handoff between jobs.
1 parent e31fa05 commit ac7ea5f

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
push:
55
pull_request:
66

7+
permissions: read-all
8+
79
jobs:
810
changes:
911
name: Detect code changes
@@ -46,6 +48,9 @@ jobs:
4648
build-native-packages:
4749
needs: changes
4850
if: needs.changes.outputs.code-changed == 'true'
51+
permissions:
52+
artifact-metadata: write
53+
contents: read
4954
runs-on: ${{ matrix.os }}
5055
timeout-minutes: 30
5156
strategy:
@@ -127,6 +132,10 @@ jobs:
127132
- changes
128133
- build-native-packages
129134
if: needs.changes.outputs.code-changed == 'true'
135+
permissions:
136+
actions: read
137+
artifact-metadata: read
138+
contents: read
130139
runs-on: ubuntu-24.04-arm
131140
outputs:
132141
urls: ${{ steps.publish.outputs.urls }}

0 commit comments

Comments
 (0)