Skip to content

Commit ed55b80

Browse files
committed
set minimal permissions for wokrflows
Signed-off-by: CrazyMax <[email protected]>
1 parent 6a6ac56 commit ed55b80

File tree

5 files changed

+9
-26
lines changed

5 files changed

+9
-26
lines changed

.github/workflows/.test.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
uses: ./.github/workflows/build.yml
2323
permissions:
2424
contents: read
25-
packages: write
2625
id-token: write
2726
with:
2827
output: ${{ github.event_name != 'pull_request' && 'registry' || 'cacheonly' }}
@@ -56,7 +55,6 @@ jobs:
5655
uses: ./.github/workflows/build.yml
5756
permissions:
5857
contents: read
59-
packages: write
6058
id-token: write
6159
with:
6260
output: ${{ github.event_name != 'pull_request' && 'registry' || 'cacheonly' }}
@@ -125,7 +123,6 @@ jobs:
125123
uses: ./.github/workflows/build.yml
126124
permissions:
127125
contents: read
128-
packages: write
129126
id-token: write
130127
with:
131128
output: ${{ github.event_name != 'pull_request' && 'registry' || 'cacheonly' }}
@@ -158,7 +155,6 @@ jobs:
158155
uses: ./.github/workflows/build.yml
159156
permissions:
160157
contents: read
161-
packages: write
162158
id-token: write
163159
with:
164160
output: ${{ github.event_name != 'pull_request' && 'registry' || 'cacheonly' }}
@@ -233,7 +229,6 @@ jobs:
233229
uses: ./.github/workflows/build.yml
234230
permissions:
235231
contents: read
236-
packages: write
237232
id-token: write
238233
with:
239234
output: ${{ github.event_name != 'pull_request' && 'local' || 'cacheonly' }}
@@ -254,7 +249,6 @@ jobs:
254249
uses: ./.github/workflows/build.yml
255250
permissions:
256251
contents: read
257-
packages: write
258252
id-token: write
259253
with:
260254
output: ${{ github.event_name != 'pull_request' && 'local' || 'cacheonly' }}
@@ -274,7 +268,6 @@ jobs:
274268
uses: ./.github/workflows/bake.yml
275269
permissions:
276270
contents: read
277-
packages: write
278271
id-token: write
279272
with:
280273
context: test
@@ -310,7 +303,6 @@ jobs:
310303
uses: ./.github/workflows/bake.yml
311304
permissions:
312305
contents: read
313-
packages: write
314306
id-token: write
315307
with:
316308
context: test
@@ -346,7 +338,6 @@ jobs:
346338
uses: ./.github/workflows/bake.yml
347339
permissions:
348340
contents: read
349-
packages: write
350341
id-token: write
351342
with:
352343
context: test
@@ -389,7 +380,6 @@ jobs:
389380
uses: ./.github/workflows/bake.yml
390381
permissions:
391382
contents: read
392-
packages: write
393383
id-token: write
394384
with:
395385
context: test
@@ -411,7 +401,6 @@ jobs:
411401
uses: ./.github/workflows/bake.yml
412402
permissions:
413403
contents: read
414-
packages: write
415404
id-token: write
416405
with:
417406
context: test

.github/workflows/bake.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: bake
22

3+
permissions:
4+
contents: read
5+
36
on:
47
workflow_call:
58
inputs:
@@ -142,8 +145,6 @@ env:
142145
jobs:
143146
prepare:
144147
runs-on: ${{ inputs.runs-on || 'ubuntu-latest' }}
145-
permissions:
146-
contents: read
147148
outputs:
148149
includes: ${{ steps.set.outputs.includes }}
149150
steps:
@@ -259,10 +260,6 @@ jobs:
259260
runs-on: ${{ matrix.runs-on }}
260261
needs:
261262
- prepare
262-
permissions:
263-
contents: read
264-
id-token: write # for signing attestation manifests with GitHub OIDC Token
265-
packages: write # only used if pushing to GHCR but needs to be defined as caller must provide permissions ≥ to those used in the reusable workflow
266263
strategy:
267264
fail-fast: false
268265
matrix:
@@ -631,9 +628,6 @@ jobs:
631628
632629
finalize:
633630
runs-on: ${{ inputs.runs-on || 'ubuntu-latest' }}
634-
permissions:
635-
contents: read
636-
packages: write # only used if pushing to GHCR but needs to be defined as caller must provide permissions ≥ to those used in the reusable workflow
637631
outputs:
638632
cosign-version: ${{ env.COSIGN_VERSION }}
639633
cosign-verify-commands: ${{ steps.set.outputs.cosign-verify-commands }}

.github/workflows/build.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: build
22

3+
permissions:
4+
contents: read
5+
36
on:
47
workflow_call:
58
inputs:
@@ -144,10 +147,6 @@ jobs:
144147
cosign-verify-commands: ${{ steps.signing-attestation-manifests.outputs.verify-commands || steps.signing-local-artifacts.outputs.verify-commands }}
145148
artifact-name: ${{ inputs.artifact-name }}
146149
output-type: ${{ inputs.output }}
147-
permissions:
148-
contents: read
149-
id-token: write # for signing attestation manifests with GitHub OIDC Token
150-
packages: write # only used if pushing to GHCR but needs to be defined as caller must provide permissions ≥ to those used in the reusable workflow
151150
steps:
152151
-
153152
name: Docker meta

.github/workflows/verify.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: verify
22

3+
permissions:
4+
contents: read
5+
36
on:
47
workflow_call:
58
inputs:

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ on:
3737
permissions:
3838
contents: read
3939
id-token: write # for signing attestation manifests with GitHub OIDC Token
40-
packages: write # only used if pushing to GHCR but needs to be defined as caller must provide permissions ≥ to those used in the reusable workflow
4140
with:
4241
output: ${{ github.event_name != 'pull_request' && 'registry' || 'cacheonly' }}
4342
meta-images: name/app
@@ -92,7 +91,6 @@ on:
9291
permissions:
9392
contents: read
9493
id-token: write # for signing attestation manifests with GitHub OIDC Token
95-
packages: write # only used if pushing to GHCR but needs to be defined as caller must provide permissions ≥ to those used in the reusable workflow
9694
with:
9795
output: ${{ github.event_name != 'pull_request' && 'registry' || 'cacheonly' }}
9896
meta-images: name/app

0 commit comments

Comments
 (0)