chore(ci): ensure minimal permission for github default token

With recent enforcing of the least permissions for GITHUB_TOKEN, pull-request from external contributors would trigger systematic error (i.e. on repository checkout) in the continuous integration pipeline.
Allowing contents:read fixes this behavior.
This commit is contained in:
David Testé
2025-05-12 16:04:11 +02:00
committed by David Testé
parent ca1c5659a1
commit aa6dadfe69
29 changed files with 59 additions and 58 deletions

View File

@@ -23,8 +23,8 @@ on:
workflow_dispatch:
pull_request:
permissions: {}
permissions:
contents: read
jobs:
setup-instance:

View File

@@ -24,8 +24,8 @@ on:
workflow_dispatch:
pull_request:
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -30,8 +30,8 @@ on:
branches:
- main
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -30,8 +30,8 @@ on:
branches:
- main
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -27,8 +27,8 @@ on:
# Nightly tests @ 1AM after each work day
- cron: "0 1 * * MON-FRI"
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -23,8 +23,8 @@ on:
pull_request:
types: [ labeled ]
permissions: {}
permissions:
contents: read
jobs:
setup-instance:

View File

@@ -22,8 +22,8 @@ on:
# Weekly benchmarks will be triggered each Friday at 9p.m.
- cron: "0 21 * * 5"
permissions: {}
permissions:
contents: read
jobs:
cuda-integer-benchmarks:

View File

@@ -14,8 +14,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
permissions: {}
permissions:
contents: read
jobs:
cargo-builds:

View File

@@ -12,8 +12,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
permissions: {}
permissions:
contents: read
jobs:
cargo-builds-fft:

View File

@@ -12,8 +12,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
permissions: {}
permissions:
contents: read
jobs:
cargo-builds-ntt:

View File

@@ -16,8 +16,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -16,8 +16,8 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref }}
cancel-in-progress: true
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -3,8 +3,9 @@ name: Check commit and PR compliance
on:
pull_request:
permissions: {}
permissions:
contents: read
pull-requests: read # Permission needed to scan commits in a pull-request
jobs:
check-commit-pr:

View File

@@ -9,7 +9,8 @@ env:
ACTIONLINT_CHECKSUM: "023070a287cd8cccd71515fedc843f1985bf96c436b7effaecce67290e7e0757"
CHECKOUT_TOKEN: ${{ secrets.REPO_CHECKOUT_TOKEN || secrets.GITHUB_TOKEN }}
permissions: {}
permissions:
contents: read
jobs:
lint-check:

View File

@@ -17,8 +17,8 @@ on:
workflow_dispatch:
# Code coverage workflow is only run via workflow_dispatch event since execution duration is not stabilized yet.
permissions: {}
permissions:
contents: read
jobs:
setup-instance:

View File

@@ -21,8 +21,8 @@ on:
pull_request:
types: [ labeled ]
permissions: {}
permissions:
contents: read
jobs:
setup-instance:

View File

@@ -22,8 +22,8 @@ on:
# Nightly tests @ 1AM after each work day
- cron: "0 1 * * MON-FRI"
permissions: {}
permissions:
contents: read
jobs:
cuda-tests-linux:

View File

@@ -25,8 +25,8 @@ on:
pull_request:
types: [ labeled ]
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -24,8 +24,8 @@ on:
workflow_dispatch:
pull_request:
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -25,8 +25,8 @@ on:
pull_request:
types: [ labeled ]
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -19,8 +19,8 @@ on:
# Nightly tests will be triggered each evening 8p.m.
- cron: "0 20 * * *"
permissions: {}
permissions:
contents: read
jobs:
setup-instance:

View File

@@ -23,8 +23,8 @@ env:
on:
pull_request:
permissions: {}
permissions:
contents: read
jobs:
setup-instance:

View File

@@ -25,8 +25,8 @@ on:
pull_request:
types: [ labeled ]
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -25,9 +25,8 @@ on:
pull_request:
types: [ labeled ]
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -29,8 +29,8 @@ on:
# Nightly tests @ 1AM after each work day
- cron: "0 1 * * MON-FRI"
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -25,9 +25,8 @@ on:
pull_request:
types: [ labeled ]
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -25,8 +25,8 @@ on:
pull_request:
types: [ labeled ]
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -29,8 +29,8 @@ on:
# Nightly tests @ 1AM after each work day
- cron: "0 1 * * MON-FRI"
permissions: {}
permissions:
contents: read
jobs:
should-run:

View File

@@ -27,7 +27,8 @@ concurrency:
group: ${{ github.workflow_ref }}
cancel-in-progress: true
permissions: {}
permissions:
contents: read
jobs:
cargo-builds-m1: