Skip to content

Commit bfa5447

Browse files
CI: add least-privilege permissions to GitHub Actions workflows (#59)
1 parent d29a971 commit bfa5447

7 files changed

Lines changed: 24 additions & 0 deletions

File tree

.github/workflows/cron-checks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ env:
1515
HOMEBREW_NO_INSTALL_CLEANUP: 1 # Disable cleanup for homebrew, we don't need it on CI
1616
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1717

18+
permissions:
19+
contents: read
20+
1821
jobs:
1922
build-and-test:
2023
name: Test

.github/workflows/release-merge.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66

77
workflow_dispatch:
88

9+
permissions:
10+
contents: write
11+
pull-requests: read
12+
913
jobs:
1014
merge-release-to-main:
1115
name: Merge release to main

.github/workflows/release-publish.yml

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

6+
permissions:
7+
contents: write
8+
69
jobs:
710
release:
811
name: Publish new release

.github/workflows/release-start.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
type: string
99
required: true
1010

11+
permissions:
12+
contents: write
13+
1114
jobs:
1215
test-release:
1316
name: Start new release

.github/workflows/smoke-checks.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ env:
2424
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2525
GITHUB_PR_NUM: ${{ github.event.pull_request.number }}
2626

27+
permissions:
28+
actions: write
29+
contents: read
30+
pull-requests: write
31+
2732
jobs:
2833
test_core:
2934
name: Test Core

.github/workflows/sonar.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ concurrency:
1212
env:
1313
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1414

15+
permissions:
16+
contents: read
17+
1518
jobs:
1619
sonar:
1720
runs-on: macos-15

.github/workflows/update-copyright.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ on:
1010
env:
1111
HOMEBREW_NO_INSTALL_CLEANUP: 1 # Disable cleanup for homebrew, we don't need it on CI
1212

13+
permissions:
14+
contents: read
15+
1316
jobs:
1417
copyright:
1518
name: Copyright

0 commit comments

Comments
 (0)