Skip to content

Commit a3d581e

Browse files
committed
fix permissions for registry auth through OIDC
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent fd3969f commit a3d581e

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

.github/workflows/bake.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ jobs:
261261
- prepare
262262
permissions:
263263
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
264+
id-token: write # for signing attestation manifests and/or registry authentication with GitHub OIDC Token
265+
packages: write # for pushing manifests to GHCR if needed
266266
strategy:
267267
fail-fast: false
268268
matrix:
@@ -633,7 +633,8 @@ jobs:
633633
runs-on: ${{ inputs.runs-on || 'ubuntu-latest' }}
634634
permissions:
635635
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
636+
id-token: write # for registry authentication with OIDC if needed
637+
packages: write # for pushing to GHCR when merging manifests if needed
637638
outputs:
638639
cosign-version: ${{ env.COSIGN_VERSION }}
639640
cosign-verify-commands: ${{ steps.set.outputs.cosign-verify-commands }}

.github/workflows/build.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ jobs:
215215
- prepare
216216
permissions:
217217
contents: read
218-
id-token: write # for signing attestation manifests with GitHub OIDC Token
219-
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
218+
id-token: write # for signing attestation manifests and/or registry authentication with GitHub OIDC Token
219+
packages: write # for pushing manifests to GHCR if needed
220220
strategy:
221221
fail-fast: false
222222
matrix:
@@ -524,7 +524,8 @@ jobs:
524524
runs-on: ${{ inputs.runs-on || 'ubuntu-latest' }}
525525
permissions:
526526
contents: read
527-
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
527+
id-token: write # for registry authentication with OIDC if needed
528+
packages: write # for pushing to GHCR when merging manifests if needed
528529
outputs:
529530
cosign-version: ${{ env.COSIGN_VERSION }}
530531
cosign-verify-commands: ${{ steps.set.outputs.cosign-verify-commands }}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ on:
3636
uses: docker/github-builder-experimental/.github/workflows/build.yml@main
3737
permissions:
3838
contents: read
39-
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
39+
id-token: write # for signing attestation manifests and registry authentication if needed with GitHub OIDC Token
40+
packages: write # for pushing manifests to GHCR if needed (caller must provide the same permissions used in the reusable workflow)
4141
with:
4242
output: ${{ github.event_name != 'pull_request' && 'registry' || 'cacheonly' }}
4343
meta-images: name/app
@@ -91,8 +91,8 @@ on:
9191
uses: docker/github-builder-experimental/.github/workflows/bake.yml@main
9292
permissions:
9393
contents: read
94-
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
94+
id-token: write # for signing attestation manifests and registry authentication if needed with GitHub OIDC Token
95+
packages: write # for pushing manifests to GHCR if needed (caller must provide the same permissions used in the reusable workflow)
9696
with:
9797
output: ${{ github.event_name != 'pull_request' && 'registry' || 'cacheonly' }}
9898
meta-images: name/app

0 commit comments

Comments
 (0)