Skip to content

Commit 8da2e51

Browse files
committed
bake: update workflow permissions
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent 46e30b8 commit 8da2e51

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

.github/workflows/bake.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ env:
139139
jobs:
140140
prepare:
141141
runs-on: ${{ inputs.runs-on || 'ubuntu-latest' }}
142+
permissions:
143+
contents: read
142144
outputs:
143145
includes: ${{ steps.set.outputs.includes }}
144146
steps:
@@ -256,8 +258,8 @@ jobs:
256258
- prepare
257259
permissions:
258260
contents: read
259-
id-token: write # needed for signing the images with GitHub OIDC Token
260-
packages: write # needed to push images to GitHub Container Registry
261+
id-token: write # for signing attestation manifests with GitHub OIDC Token
262+
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
261263
strategy:
262264
fail-fast: false
263265
matrix:
@@ -626,6 +628,9 @@ jobs:
626628
627629
post:
628630
runs-on: ${{ inputs.runs-on || 'ubuntu-latest' }}
631+
permissions:
632+
contents: read
633+
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
629634
outputs:
630635
cosign-version: ${{ env.COSIGN_VERSION }}
631636
cosign-verify-commands: ${{ steps.set.outputs.cosign-verify-commands }}

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ jobs:
142142
artifact-name: ${{ inputs.artifact-name }}
143143
permissions:
144144
contents: read
145-
id-token: write # needed for signing the images with GitHub OIDC Token
146-
packages: write # needed to push images to GitHub Container Registry
145+
id-token: write # for signing attestation manifests with GitHub OIDC Token
146+
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
147147
steps:
148148
-
149149
name: Docker meta

0 commit comments

Comments
 (0)