Skip to content

Commit 86037b2

Browse files
authored
Update github permissions (#833)
* Update github permissions * Replace version by commit sha
1 parent 352b4ec commit 86037b2

15 files changed

+61
-2
lines changed

.github/workflows/cmake-checks.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ on:
2525
- '**.cmake.in'
2626
workflow_dispatch:
2727

28+
permissions:
29+
contents: read
30+
2831
jobs:
2932
cmake-format:
3033
name: CMake format check using gersemi

.github/workflows/early_integration.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
- cron: "0 1 * * 1-5" # every weekday at 1am
1212
workflow_dispatch:
1313

14+
permissions:
15+
contents: read
16+
1417
jobs:
1518
docker-build:
1619
strategy:
@@ -83,6 +86,8 @@ jobs:
8386
cxx_version: '23'
8487
runs-on: ubuntu-latest
8588
needs: [docker-build]
89+
permissions:
90+
checks: write # Required by mikepenz/action-junit-report
8691
steps:
8792
- name: Free Disk Space (Ubuntu)
8893
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

.github/workflows/general-checks.yaml

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

16+
permissions:
17+
contents: read
18+
1619
jobs:
1720
reuse-compliance-check:
1821
name: Reuse compliance check

.github/workflows/gyselalibxx.yaml

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

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
tests:
1417
strategy:

.github/workflows/markdown-checks.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ on:
1919
- '**.md'
2020
workflow_dispatch:
2121

22+
permissions:
23+
contents: read
24+
2225
jobs:
2326
markdown-lint:
2427
name: Markdown lint using markdownlint-cli2

.github/workflows/packages-cleanup.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ name: Packages cleanup
99
on:
1010
workflow_dispatch:
1111

12+
permissions:
13+
contents: read
14+
1215
jobs:
1316
delete-packages:
1417
strategy:
@@ -24,6 +27,8 @@ jobs:
2427
- 'oldest_hip'
2528
name: Delete old packages
2629
runs-on: ubuntu-latest
30+
permissions:
31+
packages: write # Required by actions/delete-package-versions
2732
steps:
2833
- uses: actions/delete-package-versions@e5bc658cc4c965c472efe991f8beea3981499c55 # v5.0.0
2934
with:

.github/workflows/pages.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ concurrency:
1616
group: ${{github.workflow}}-${{github.ref == github.ref_protected && github.run_id || github.event.pull_request.number || github.ref}}
1717
cancel-in-progress: true
1818

19+
permissions:
20+
contents: read
21+
1922
jobs:
2023
id_repo:
2124
runs-on: ubuntu-latest
@@ -29,6 +32,8 @@ jobs:
2932
docker-build:
3033
needs: id_repo
3134
runs-on: ubuntu-latest
35+
permissions:
36+
packages: write # Required to push to registry
3237
steps:
3338
- name: Free Disk Space (Ubuntu)
3439
uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1

.github/workflows/python-checks.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ on:
2121
- 'bin/trailing_spaces'
2222
workflow_dispatch:
2323

24+
permissions:
25+
contents: read
26+
2427
jobs:
2528
python-format:
2629
name: Python format using black

.github/workflows/scorecard.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ on:
2323
- "main"
2424

2525
# Declare default permissions as read only.
26-
permissions: read-all
26+
permissions:
27+
contents: read
2728

2829
jobs:
2930
analysis:
@@ -78,6 +79,6 @@ jobs:
7879
# Upload the results to GitHub's code scanning dashboard (optional).
7980
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
8081
- name: "Upload to code-scanning"
81-
uses: github/codeql-action/upload-sarif@v3
82+
uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15
8283
with:
8384
sarif_file: results.sarif

.github/workflows/shell-checks.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
- 'docker/*/bash_run'
1616
workflow_dispatch:
1717

18+
permissions:
19+
contents: read
20+
1821
jobs:
1922
shell-lint:
2023
name: Shell lint using shellcheck

0 commit comments

Comments
 (0)