Skip to content

Commit 546370c

Browse files
authored
Set minimal permissions to Github Workflows (#3972)
1 parent bbe337c commit 546370c

File tree

7 files changed

+26
-0
lines changed

7 files changed

+26
-0
lines changed

.github/workflows/cifuzz.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: CIFuzz
22
on: [pull_request]
3+
4+
permissions:
5+
contents: read
6+
37
jobs:
48
Fuzzing:
59
runs-on: ubuntu-latest

.github/workflows/codeql-analysis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
schedule:
1111
- cron: '0 19 * * 1'
1212
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
1316

1417
concurrency:
1518
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
@@ -19,6 +22,8 @@ jobs:
1922
CodeQL-Build:
2023

2124
runs-on: ubuntu-latest
25+
permissions:
26+
security-events: write
2227

2328
steps:
2429
- name: Checkout repository

.github/workflows/labeler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ on:
44
pull_request_target:
55
types: [opened, synchronize]
66

7+
permissions: {}
8+
79
jobs:
810
label:
911
permissions:

.github/workflows/macos.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
pull_request:
1010
workflow_dispatch:
1111

12+
permissions:
13+
contents: read
14+
1215
concurrency:
1316
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
1417
cancel-in-progress: true

.github/workflows/publish_documentation.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
- docs/examples/**
1111
workflow_dispatch:
1212

13+
permissions:
14+
contents: read
15+
1316
# we don't want to have concurrent jobs, and we don't want to cancel running jobs to avoid broken publications
1417
concurrency:
1518
group: documentation

.github/workflows/ubuntu.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
- release/*
99
pull_request:
1010
workflow_dispatch:
11+
12+
permissions:
13+
contents: read
1114

1215
concurrency:
1316
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
@@ -102,6 +105,9 @@ jobs:
102105
ci_test_coverage:
103106
runs-on: ubuntu-latest
104107
container: ghcr.io/nlohmann/json-ci:v2.4.0
108+
permissions:
109+
contents: read
110+
checks: write
105111
steps:
106112
- uses: actions/checkout@v3
107113
- name: Run CMake

.github/workflows/windows.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
pull_request:
1010
workflow_dispatch:
1111

12+
permissions:
13+
contents: read
14+
1215
concurrency:
1316
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
1417
cancel-in-progress: true

0 commit comments

Comments
 (0)