Skip to content

Commit a81c518

Browse files
committed
ci: scope GITHUB_TOKEN permissions per job
Set a top-level permissions: {} on each workflow and grant each job the narrowest GITHUB_TOKEN scopes it actually needs (contents: read for checkout-based jobs, id-token: write preserved for the PyPI trusted publishing jobs). Previously the workflows ran with the repository's default token permissions.
1 parent 402f540 commit a81c518

4 files changed

Lines changed: 16 additions & 1 deletion

File tree

.github/workflows/check.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ on:
1111
branches:
1212
- main
1313

14+
permissions: {}
15+
1416
jobs:
1517
check:
16-
18+
permissions:
19+
contents: read
1720
runs-on: ubuntu-22.04
1821
strategy:
1922
fail-fast: false

.github/workflows/features.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ on:
66
branches:
77
- main
88

9+
permissions: {}
10+
911
jobs:
1012
build:
13+
permissions:
14+
contents: read
1115
uses: ably/features/.github/workflows/sdk-features.yml@main
1216
with:
1317
repository-name: ably-python

.github/workflows/lint.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,12 @@ on:
66
branches:
77
- main
88

9+
permissions: {}
10+
911
jobs:
1012
lint:
13+
permissions:
14+
contents: read
1115
runs-on: ubuntu-latest
1216
steps:
1317
- uses: actions/checkout@v4

.github/workflows/release.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,14 @@ on:
66
tags:
77
- 'v[0-9]+.[0-9]+.[0-9]+*'
88

9+
permissions: {}
10+
911
jobs:
1012
build:
1113
name: Build distribution 📦
1214
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
1317

1418
steps:
1519
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)