Skip to content

Commit 2ea9647

Browse files
authored
ci: add permission comments and remove redundant comments from workflows (#1985)
1 parent 85b235d commit 2ea9647

File tree

7 files changed

+22
-32
lines changed

7 files changed

+22
-32
lines changed

.github/workflows/asset-checksums-reusable.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ on:
1414
type: string
1515
required: false
1616

17-
permissions:
18-
contents: write
19-
2017
jobs:
2118
tag:
2219
name: Tag

.github/workflows/aur-reusable.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
jobs:
1313
release-info:
1414
permissions:
15-
packages: read
15+
packages: read # needed to read release info from GitHub Packages
1616
runs-on: ubuntu-slim
1717
outputs:
1818
version: ${{ steps.version.outputs.version }}
@@ -30,8 +30,6 @@ jobs:
3030
update-aur:
3131
needs:
3232
- release-info
33-
permissions:
34-
packages: read
3533
runs-on: ubuntu-latest
3634
container:
3735
image: ghcr.io/hrzlgnm/mdns-browser-arch-aur-builder:v1@sha256:d06a3c63493066b249b3bdb8b0e503a0936eecaa06259c94a5f466e7a08135d5

.github/workflows/ci.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
if: github.event_name == 'pull_request'
3232
name: "🏷️ Label PR"
3333
permissions:
34-
contents: read # Needed to read repository contents
35-
pull-requests: write # Needed to apply labels
36-
issues: write # Needed to create non existing labels
34+
contents: read # needed to read repository contents for labeler config
35+
pull-requests: write # needed to apply labels to PRs
36+
issues: write # needed to create non-existing labels
3737
runs-on: ubuntu-slim
3838

3939
steps:
@@ -159,7 +159,7 @@ jobs:
159159
needs: changes
160160
if: needs.changes.outputs.tauri == 'true' || needs.changes.outputs.android == 'true'
161161
permissions:
162-
contents: write
162+
contents: write # needed to upload build artifacts
163163
uses: ./.github/workflows/android-reusable.yml
164164
secrets: inherit
165165
with:
@@ -170,7 +170,7 @@ jobs:
170170
needs: changes
171171
if: needs.changes.outputs.tauri == 'true' || needs.changes.outputs.desktop == 'true'
172172
permissions:
173-
contents: write
173+
contents: write # needed to upload build artifacts
174174
uses: ./.github/workflows/desktop-reusable.yml
175175
secrets: inherit
176176
with:
@@ -191,8 +191,8 @@ jobs:
191191
needs: changes
192192
if: needs.changes.outputs.docker == 'true'
193193
permissions:
194-
contents: read
195-
packages: write # Needed to push to GHCR
194+
contents: read # needed to checkout code for docker build
195+
packages: write # needed to push to GHCR
196196

197197
uses: hrzlgnm/actions/.github/workflows/docker-reusable.yml@292498dae084d4097c6dea750cf8b23f865a83eb # v2.0.4
198198
with:

.github/workflows/publish-sbom-reusable.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@ on:
1010
type: string
1111
required: false
1212

13-
permissions:
14-
contents: write
15-
actions: read
16-
1713
jobs:
1814
tag:
1915
name: Tag

.github/workflows/release.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ jobs:
176176
needs: [bump_version, create_prerelease]
177177
if: (inputs.create-release && !inputs.dry-run)
178178
permissions:
179-
id-token: write
180-
attestations: write
181-
contents: write
182-
actions: read
179+
id-token: write # needed for OIDC token for attestation
180+
attestations: write # needed to create build attestations
181+
contents: write # needed to upload build artifacts
182+
actions: read # needed to download workflow artifacts
183183
name: 🔨 Build Android
184184
uses: ./.github/workflows/android-reusable.yml
185185
secrets: inherit
@@ -190,10 +190,10 @@ jobs:
190190
needs: [bump_version, create_prerelease]
191191
if: (inputs.create-release && !inputs.dry-run)
192192
permissions:
193-
id-token: write
194-
attestations: write
195-
contents: write
196-
actions: read
193+
id-token: write # needed for OIDC token for attestation
194+
attestations: write # needed to create build attestations
195+
contents: write # needed to upload build artifacts
196+
actions: read # needed to download workflow artifacts
197197
name: 🔨 Build Desktop
198198
uses: ./.github/workflows/desktop-reusable.yml
199199
secrets: inherit
@@ -204,10 +204,10 @@ jobs:
204204
needs: [bump_version, create_prerelease, source_checksums]
205205
if: (inputs.create-release && !inputs.dry-run)
206206
permissions:
207-
id-token: write
208-
attestations: write
209-
contents: write
210-
actions: read
207+
id-token: write # needed for OIDC token for attestation
208+
attestations: write # needed to create build attestations
209+
contents: write # needed to upload build artifacts
210+
actions: read # needed to download workflow artifacts
211211
name: 🔨 Build Void
212212
uses: ./.github/workflows/void-reusable.yml
213213
secrets: inherit

.github/workflows/source-checksums-reusable.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ on:
1414
type: string
1515
required: false
1616

17-
permissions:
18-
contents: write
19-
2017
jobs:
2118
tag:
2219
name: Tag

.github/workflows/winget-reusable.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ on:
1111

1212
jobs:
1313
publish:
14+
permissions:
15+
contents: read # needed to checkout repository for release info
1416
runs-on: ubuntu-latest
1517
steps:
1618
- name: 🔄 Checkout

0 commit comments

Comments
 (0)