Skip to content

Commit f15b0c9

Browse files
committed
fix missing builder-id in provenance
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
1 parent 8790a28 commit f15b0c9

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

.github/workflows/bake.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ jobs:
582582
script: |
583583
const os = require('os');
584584
const { Bake } = require('@docker/actions-toolkit/lib/buildx/bake');
585+
const { Build } = require('@docker/actions-toolkit/lib/buildx/build');
585586
const { GitHub } = require('@docker/actions-toolkit/lib/github');
586587
const { Util } = require('@docker/actions-toolkit/lib/util');
587588
@@ -709,10 +710,10 @@ jobs:
709710
bakeOverrides.push('*.tags=');
710711
if (GitHub.context.payload.repository?.private ?? false) {
711712
// if this is a private repository, we set min provenance mode
712-
bakeOverrides.push('*.attest=type=provenance,mode=min,version=v1');
713+
bakeOverrides.push(`*.attest=type=provenance,${Build.resolveProvenanceAttrs('mode=min,version=v1')}`);
713714
} else {
714715
// for a public repository, we set max provenance mode
715-
bakeOverrides.push('*.attest=type=provenance,mode=max,version=v1');
716+
bakeOverrides.push(`*.attest=type=provenance,${Build.resolveProvenanceAttrs('mode=max,version=v1')}`);
716717
}
717718
if (inpPlatform) {
718719
bakeOverrides.push(`*.platform=${inpPlatform}`);

.github/workflows/build.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ jobs:
515515
INPUT_META-LABELS: ${{ steps.meta.outputs.labels }}
516516
with:
517517
script: |
518+
const { Build } = require('@docker/actions-toolkit/lib/buildx/build');
518519
const { GitHub } = require('@docker/actions-toolkit/lib/github');
519520
520521
const inpPlatform = core.getInput('platform');
@@ -587,10 +588,10 @@ jobs:
587588
588589
if (GitHub.context.payload.repository?.private ?? false) {
589590
// if this is a private repository, we set min provenance mode
590-
core.setOutput('provenance', 'mode=min,version=v1');
591+
core.setOutput('provenance', Build.resolveProvenanceAttrs(`mode=min,version=v1`));
591592
} else {
592593
// for a public repository, we set max provenance mode
593-
core.setOutput('provenance', 'mode=max,version=v1');
594+
core.setOutput('provenance', Build.resolveProvenanceAttrs(`mode=max,version=v1`));
594595
}
595596
-
596597
name: Login to registry

0 commit comments

Comments
 (0)