Skip to content

Commit 4c45791

Browse files
committed
Fix Token-Permissions OpenSSF remarks
1 parent 6663f0a commit 4c45791

9 files changed

Lines changed: 90 additions & 0 deletions

File tree

.github/workflows/codeql.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ on:
55
- cron: '0 0 * * *'
66
workflow_dispatch:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
analyze:
1013
name: Analyze

.github/workflows/labeler.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ name: "Label PRs"
33
on:
44
- pull_request_target
55

6+
permissions:
7+
contents: read
8+
69
jobs:
710
label-pull-requests:
811
runs-on: ubuntu-24.04

.github/workflows/mac.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
on:
22
workflow_call:
33

4+
permissions:
5+
contents: read
6+
47
jobs:
58
clang-build:
69
runs-on: macOS-latest

.github/workflows/main.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- cron: '0 0 * * *'
99
workflow_dispatch:
1010

11+
permissions:
12+
contents: read
13+
1114
concurrency:
1215
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}
1316
cancel-in-progress: >-
@@ -18,26 +21,45 @@ concurrency:
1821
jobs:
1922
pre-commit:
2023
uses: ./.github/workflows/pre-commit.yml
24+
permissions:
25+
contents: read
26+
packages: read
2127
ubuntu:
2228
needs:
2329
- pre-commit
2430
uses: ./.github/workflows/ubuntu.yml
31+
permissions:
32+
contents: read
33+
packages: read
34+
issues: write
35+
pull-requests: write
2536
mac:
2637
needs:
2738
- pre-commit
2839
uses: ./.github/workflows/mac.yml
40+
permissions:
41+
contents: read
2942
windows:
3043
needs:
3144
- pre-commit
3245
uses: ./.github/workflows/windows.yml
46+
permissions:
47+
contents: read
3348
perf:
3449
needs:
3550
- ubuntu
3651
- mac
3752
- windows
3853
uses: ./.github/workflows/perf.yml
54+
permissions:
55+
contents: read
56+
packages: read
3957

4058
pages:
4159
needs:
4260
- perf
4361
uses: ./.github/workflows/pages.yml
62+
permissions:
63+
contents: read
64+
pages: write
65+
id-token: write

.github/workflows/perf.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
on:
22
workflow_call:
33

4+
permissions:
5+
contents: read
6+
47
jobs:
58
ubuntu-gcc-build-perf-stats:
69
runs-on: ubuntu-24.04
10+
permissions:
11+
contents: read
12+
packages: read
713
container:
814
image: ghcr.io/learning-process/ppc-ubuntu:1.1
915
credentials:

.github/workflows/pre-commit.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,15 @@ on:
55
pull_request:
66
workflow_call:
77

8+
permissions:
9+
contents: read
10+
811
jobs:
912
pre-commit:
1013
runs-on: ubuntu-24.04
14+
permissions:
15+
contents: read
16+
packages: read
1117
container:
1218
image: ghcr.io/learning-process/ppc-ubuntu:1.1
1319
credentials:

.github/workflows/static-analysis-pr.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,15 @@ concurrency:
1919
github.event_name != 'merge_group' &&
2020
!startsWith(github.ref, 'refs/heads/gh-readonly-queue') }}
2121
22+
permissions:
23+
contents: read
24+
2225
jobs:
2326
clang-tidy:
2427
runs-on: ubuntu-24.04
28+
permissions:
29+
contents: read
30+
packages: read
2531
container:
2632
image: ghcr.io/learning-process/ppc-ubuntu:1.1
2733
credentials:
@@ -71,6 +77,9 @@ jobs:
7177
needs:
7278
- clang-tidy
7379
runs-on: ubuntu-24.04
80+
permissions:
81+
contents: read
82+
packages: read
7483
container:
7584
image: ghcr.io/learning-process/ppc-ubuntu:1.1
7685
credentials:

.github/workflows/ubuntu.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
on:
22
workflow_call:
33

4+
permissions:
5+
contents: read
6+
47
jobs:
58
gcc-build:
69
runs-on: ${{ matrix.os }}
10+
permissions:
11+
contents: read
12+
packages: read
713
container:
814
image: ghcr.io/learning-process/ppc-ubuntu:1.1
915
credentials:
@@ -58,6 +64,9 @@ jobs:
5864
needs:
5965
- gcc-build
6066
runs-on: ${{ matrix.os }}
67+
permissions:
68+
contents: read
69+
packages: read
6170
container:
6271
image: ghcr.io/learning-process/ppc-ubuntu:1.1
6372
credentials:
@@ -90,6 +99,9 @@ jobs:
9099
needs:
91100
- gcc-test
92101
runs-on: ${{ matrix.os }}
102+
permissions:
103+
contents: read
104+
packages: read
93105
container:
94106
image: ghcr.io/learning-process/ppc-ubuntu:1.1
95107
credentials:
@@ -114,6 +126,9 @@ jobs:
114126
PPC_NUM_PROC: 1
115127
clang-build:
116128
runs-on: ${{ matrix.os }}
129+
permissions:
130+
contents: read
131+
packages: read
117132
container:
118133
image: ghcr.io/learning-process/ppc-ubuntu:1.1
119134
credentials:
@@ -159,6 +174,9 @@ jobs:
159174
needs:
160175
- clang-build
161176
runs-on: ${{ matrix.os }}
177+
permissions:
178+
contents: read
179+
packages: read
162180
container:
163181
image: ghcr.io/learning-process/ppc-ubuntu:1.1
164182
credentials:
@@ -191,6 +209,9 @@ jobs:
191209
needs:
192210
- clang-test
193211
runs-on: ${{ matrix.os }}
212+
permissions:
213+
contents: read
214+
packages: read
194215
container:
195216
image: ghcr.io/learning-process/ppc-ubuntu:1.1
196217
credentials:
@@ -217,6 +238,9 @@ jobs:
217238
needs:
218239
- clang-build
219240
runs-on: ${{ matrix.os }}
241+
permissions:
242+
contents: read
243+
packages: read
220244
container:
221245
image: ghcr.io/learning-process/ppc-ubuntu:1.1
222246
credentials:
@@ -264,6 +288,9 @@ jobs:
264288
needs:
265289
- clang-sanitizer-build
266290
runs-on: ${{ matrix.os }}
291+
permissions:
292+
contents: read
293+
packages: read
267294
container:
268295
image: ghcr.io/learning-process/ppc-ubuntu:1.1
269296
credentials:
@@ -302,6 +329,9 @@ jobs:
302329
needs:
303330
- clang-sanitizer-test
304331
runs-on: ${{ matrix.os }}
332+
permissions:
333+
contents: read
334+
packages: read
305335
container:
306336
image: ghcr.io/learning-process/ppc-ubuntu:1.1
307337
credentials:
@@ -330,6 +360,11 @@ jobs:
330360
- gcc-test-extended
331361
- clang-test-extended
332362
runs-on: ubuntu-24.04
363+
permissions:
364+
contents: read
365+
packages: read
366+
issues: write
367+
pull-requests: write
333368
container:
334369
image: ghcr.io/learning-process/ppc-ubuntu:1.1
335370
credentials:

.github/workflows/windows.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
on:
22
workflow_call:
33

4+
permissions:
5+
contents: read
6+
47
jobs:
58
msvc-build:
69
runs-on: windows-latest

0 commit comments

Comments
 (0)