Skip to content

Commit bc6da78

Browse files
committed
ci: add explicit permissions to GitHub Actions workflows
Most workflows lacked a `permissions` block, causing GitHub security warnings. Added `permissions: contents: read` at the top level for all affected workflows. Special cases: - `benchmark-comment-trigger`: also needs `pull-requests: read` to call the pulls REST API - `nightly_run`: `run` job needs `actions: write` to dispatch `file_verification.yml` - `rust`: `clippy` job-level permissions updated to include `contents: read` alongside `checks: write` - `cargo-publish`: `build` job updated to include `contents: read` alongside `id-token: write`
1 parent 6112a34 commit bc6da78

20 files changed

Lines changed: 65 additions & 0 deletions

.github/workflows/approve-rc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
default: false
1414
type: boolean
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
approve-rc:
1821
runs-on: ubuntu-latest

.github/workflows/benchmark-comment-trigger.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ on:
1313
issue_comment:
1414
types: [created]
1515

16+
permissions:
17+
contents: read
18+
pull-requests: read
19+
1620
jobs:
1721
forward-to-bench:
1822
# Only process comments on PRs that mention @bench-bot and contain 'benchmark'

.github/workflows/benchmarks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: Run benchmarks
33
on:
44
workflow_dispatch:
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
dataset:
811
timeout-minutes: 30

.github/workflows/buf-publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
default: ''
1212
type: string
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
push-module:
1619
runs-on: ubuntu-latest

.github/workflows/cargo-publish.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,15 @@ env:
2424
CARGO_INCREMENTAL: "0"
2525
RUSTFLAGS: "-C debuginfo=0"
2626

27+
permissions:
28+
contents: read
29+
2730
jobs:
2831
build:
2932
# Needs additional disk space for the full build.
3033
runs-on: ubuntu-24.04-8x
3134
permissions:
35+
contents: read
3236
id-token: write
3337
timeout-minutes: 60
3438
env:

.github/workflows/ci-benchmarks.yml

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

9+
permissions:
10+
contents: read
11+
912
jobs:
1013
bench_regress:
1114
timeout-minutes: 120

.github/workflows/create-rc.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
default: false
1414
type: boolean
1515

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
create-rc:
1821
runs-on: ubuntu-latest

.github/workflows/create-release-branch.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
default: false
1515
type: boolean
1616

17+
permissions:
18+
contents: read
19+
1720
jobs:
1821
create-release-branch:
1922
runs-on: ubuntu-latest

.github/workflows/docs-check.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ on:
1313
- docs/**
1414
- .github/workflows/docs-check.yml
1515

16+
permissions:
17+
contents: read
18+
1619
env:
1720
RUSTFLAGS: "-C debuginfo=0"
1821
# according to: https://matklad.github.io/2021/09/04/fast-rust-builds.html

.github/workflows/java-publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ on:
2424
required: false
2525
type: string
2626

27+
permissions:
28+
contents: read
29+
2730
jobs:
2831
linux-arm64:
2932
name: Build on Linux Arm64

0 commit comments

Comments
 (0)