Skip to content

Commit d630a5f

Browse files
authored
Add attestation for gh build
1 parent 0e65052 commit d630a5f

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

.github/workflows/docker.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ jobs:
9999
100100
101101
- name: Attest Build Provenance
102-
uses: actions/attest-build-provenance@v1
102+
id: gh_build_provenance
103+
uses: actions/attest-build-provenance@v2
103104
with:
104105
subject-name: ${{ env.IMAGE }}
105106
subject-digest: ${{ steps.docker_build.outputs.digest }}
@@ -154,7 +155,19 @@ jobs:
154155
--fingerprint ${{ env.FINGERPRINT }}
155156
--attachments sbom.spdx.json
156157
--org ${{ inputs.kosli_org }}
157-
158+
159+
- name: Report GH Build Attestation to Kosli
160+
if: ${{ github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/') }}
161+
env:
162+
KOSLI_API_TOKEN: ${{ secrets.kosli_api_token }}
163+
run:
164+
kosli attest generic
165+
--flow ${{ inputs.flow_name }}
166+
--trail ${{ inputs.trail_name }}
167+
--name cli-docker.build
168+
--fingerprint ${{ env.FINGERPRINT }}
169+
--attachments ${{ steps.gh_build_provenance.outputs.bundle-path }}
170+
--org ${{ inputs.kosli_org }}
158171

159172
- name: Run Snyk to scan the Docker image for vulnerabilities
160173
env:

0 commit comments

Comments
 (0)