Skip to content

Commit

Permalink
ci: set provenance builder-id
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Dec 14, 2022
1 parent 28a1383 commit 6987b01
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion hack/util
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

: "${CI=}"
: "${GITHUB_ACTIONS=}"
: "${GITHUB_REPOSITORY=}"
: "${GITHUB_RUN_ID=}"
: "${BUILDX_BUILDER=}"

: "${CONTEXT=}"
Expand Down Expand Up @@ -39,7 +41,11 @@ buildxCmd() {

buildAttestFlags() {
if $buildxBin build --help 2>&1 | grep -- '--attest' >/dev/null; then
echo "--attest=type=sbom --attest=type=provenance,mode=max"
prvattrs="mode=max"
if [ "$GITHUB_ACTIONS" = "true" ]; then
prvattrs="$prvattrs,builder-id=https://github.com/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}"
fi
echo "--attest=type=sbom --attest=type=provenance,$prvattrs"
fi
}

Expand Down

0 comments on commit 6987b01

Please sign in to comment.