Skip to content

Commit 6145727

Browse files
committed
fix: permissions on CI jobs
1 parent d08e22b commit 6145727

File tree

4 files changed

+27
-2
lines changed

4 files changed

+27
-2
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,18 @@ concurrency:
2121
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
2222
cancel-in-progress: true
2323

24+
permissions: {}
25+
2426
jobs:
2527
pre_commit:
2628
name: Pre-commit checks
29+
permissions:
30+
contents: read
2731
runs-on: ubuntu-latest
2832
steps:
2933
- uses: actions/checkout@v6
34+
with:
35+
persist-credentials: false
3036
- uses: actions/setup-python@v6
3137
with:
3238
python-version: "3.x"
@@ -63,7 +69,7 @@ jobs:
6369
needs: build_matrix
6470
runs-on: ${{ matrix.runner }}
6571
permissions:
66-
packages: write
72+
packages: write # needed to write image cache
6773
contents: read
6874
strategy:
6975
fail-fast: false
@@ -79,6 +85,7 @@ jobs:
7985
uses: actions/checkout@v6
8086
with:
8187
fetch-depth: 50
88+
persist-credentials: false
8289

8390
- name: Set up QEMU
8491
if: matrix.platform == 'ppc64le' || matrix.platform == 'riscv64' || matrix.platform == 's390x'

.github/workflows/clean-cache.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,15 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
1616
cancel-in-progress: false
1717

18+
permissions: {}
19+
1820
jobs:
1921
cleanup:
2022
if: github.repository == 'pypa/manylinux'
2123
name: Clean image cache
2224
runs-on: ubuntu-latest
2325
permissions:
24-
packages: write
26+
packages: write # needed to delete images
2527
steps:
2628
- uses: dataaxiom/ghcr-cleanup-action@cd0cdb900b5dbf3a6f2cc869f0dbb0b8211f50c4 # v1.0.16
2729
with:

.github/workflows/multiarch.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,17 @@ concurrency:
99
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
1010
cancel-in-progress: false
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
deploy:
1417
name: Deploy multi-arch images
1518
runs-on: ubuntu-latest
1619
steps:
1720
- uses: actions/checkout@v6
21+
with:
22+
persist-credentials: false
1823
- name: Install ORAS
1924
run: sudo snap install oras --classic
2025
- name: Deploy

.github/workflows/update-dependencies.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,23 @@ on:
1111
env:
1212
FORCE_COLOR: '1'
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
16+
cancel-in-progress: true
17+
18+
permissions: {}
19+
1420
jobs:
1521
update-dependencies:
1622
name: Update dependencies
23+
permissions:
24+
contents: write # needed to create new branch
25+
pull-requests: write # needed to create PR for the new branch
1726
runs-on: ubuntu-latest
1827
steps:
1928
- uses: actions/checkout@v6
29+
with:
30+
persist-credentials: false
2031
- uses: wntrblm/nox@2025.11.12
2132
with:
2233
python-versions: "3.12"

0 commit comments

Comments
 (0)