Skip to content

Commit 0067870

Browse files
authored
feat: enable sbom and provenance (#11)
1 parent 55cb435 commit 0067870

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

.github/workflows/branch.yml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ jobs:
5353
out
5454
~/.foundry
5555
56+
- name: Install Cosign
57+
uses: sigstore/cosign-installer@v3
58+
5659
- name: Login to GitHub Container Registry
5760
uses: docker/login-action@v3
5861
with:
@@ -83,7 +86,7 @@ jobs:
8386
id: test
8487

8588
- name: Docker meta
86-
id: meta
89+
id: docker_meta
8790
uses: docker/metadata-action@v5
8891
with:
8992
# list of Docker images to use as base name for tags
@@ -101,10 +104,24 @@ jobs:
101104
102105
- name: Build and push
103106
uses: docker/build-push-action@v5
107+
id: build-and-push
104108
with:
105109
load: false
110+
provenance: true
111+
sbom: true
106112
push: true
107113
platforms: linux/amd64,linux/arm64
108-
tags: ${{ steps.meta.outputs.tags }}
109-
labels: ${{ steps.meta.outputs.labels }}
114+
tags: ${{ steps.docker_meta.outputs.tags }}
115+
labels: ${{ steps.docker_meta.outputs.labels }}
110116
no-cache: true
117+
118+
- name: Sign the images with GitHub OIDC Token
119+
env:
120+
DIGEST: ${{ steps.build-and-push.outputs.digest }}
121+
TAGS: ${{ steps.docker_meta.outputs.tags }}
122+
run: |
123+
images=""
124+
for tag in ${TAGS}; do
125+
images+="${tag}@${DIGEST} "
126+
done
127+
cosign sign --yes ${images}

0 commit comments

Comments
 (0)