Skip to content

Commit 2a1a273

Browse files
committed
ci: restrict GITHUB_TOKEN to read access where possible
The create_release job needs write access, but nothing else does.
1 parent 16e9839 commit 2a1a273

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

.github/workflows/build_all.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
# Run every Sunday at midnight
1111
- cron: '0 0 * * 0'
1212

13+
permissions:
14+
contents: read
15+
1316
env:
1417
TEST_BUILD_ALL: 1
1518
TEST_FATAL_WARNINGS: ${{ github.event.inputs.fatal_warnings }}

.github/workflows/release.yml

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

8+
permissions:
9+
contents: read
10+
811
concurrency:
912
group: ${{ github.workflow }}
1013
# We do NOT want `cancel-in-progress` here since only one website job
@@ -13,13 +16,16 @@ concurrency:
1316
jobs:
1417
create_release:
1518
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
1621
steps:
1722
- uses: actions/checkout@v4
1823
with:
1924
fetch-depth: 0
2025
- name: Upload release assets
2126
run: |
2227
./tools/create_release.py ${{ github.repository }} ${{ secrets.GITHUB_TOKEN }}
28+
2329
# Ideally we should trigger Meson's CI to update the website, but unfortunately
2430
# it requires a Personal Access Token. Instead clone meson and do it ourself.
2531
# This job is copied from Meson's workflows.

.github/workflows/sanity_checks.yml

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

8+
permissions:
9+
contents: read
10+
811
concurrency:
912
group: ${{ github.workflow }}-${{ github.ref }}
1013
cancel-in-progress: true

0 commit comments

Comments
 (0)