Skip to content

Commit 1729a8d

Browse files
Merge pull request #93 from leanix/feature/cid-3581/generate-sbom-artifact
cid-3581 test sbom generation on dev image
2 parents 7bd230d + e0d6cdd commit 1729a8d

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

.github/workflows/publish-dev-docker-image.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,28 @@ jobs:
6060
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dev
6161
labels: ${{ steps.meta.outputs.labels }}
6262

63+
- name: Derive SBOM artifact name
64+
id: derive-artifact-name
65+
shell: bash
66+
run: |
67+
# These are outputs (not vars) so that they can be used as input to the upload step
68+
echo "SBOM_ARTIFACT_NAME=$(echo ${{ env.IMAGE_NAME }} | sed 's/\//_/g')" >> $GITHUB_OUTPUT
69+
echo "SBOM_DIR=./sbom" >> $GITHUB_OUTPUT
70+
71+
- name: Generate SBOM artifact
72+
run: |
73+
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s --
74+
./bin/syft --version
75+
./bin/syft ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag-action.outputs.tag }} \
76+
--scope "all-layers" \
77+
--output "cyclonedx-json=${{ steps.derive-artifact-name.outputs.SBOM_DIR }}/${{ steps.derive-artifact-name.outputs.SBOM_ARTIFACT_NAME }}"
78+
79+
- name: Upload SBOM
80+
uses: actions/upload-artifact@v3
81+
with:
82+
name: ${{ steps.derive-artifact-name.outputs.SBOM_ARTIFACT_NAME }}
83+
path: ${{ steps.derive-artifact-name.outputs.SBOM_DIR }}
84+
6385
- name: Generate artifact attestation
6486
uses: actions/attest-build-provenance@v1
6587
with:

.github/workflows/snyk-scan.yml

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)