Skip to content

Commit 0673ddb

Browse files
Merge pull request #97 from leanix/feature/cid-3581/generate-sbom-artifact
cid-3581 removes sbom generation from dev workflow and adds it to the…
2 parents 968f911 + 29c7ca6 commit 0673ddb

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

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

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -60,28 +60,6 @@ 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 }}-sbom | 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 }}:dev \
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@v4
81-
with:
82-
name: ${{ steps.derive-artifact-name.outputs.SBOM_ARTIFACT_NAME }}
83-
path: ${{ steps.derive-artifact-name.outputs.SBOM_DIR }}
84-
8563
- name: Generate artifact attestation
8664
uses: actions/attest-build-provenance@v1
8765
with:

.github/workflows/publish-package-to-ghcr.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,28 @@ jobs:
110110
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag-action.outputs.tag }}
111111
labels: ${{ steps.meta.outputs.labels }}
112112

113+
- name: Derive SBOM artifact name
114+
id: derive-artifact-name
115+
shell: bash
116+
run: |
117+
# These are outputs (not vars) so that they can be used as input to the upload step
118+
echo "SBOM_ARTIFACT_NAME=$(echo ${{ env.IMAGE_NAME }}-public-sbom | sed 's/\//_/g')" >> $GITHUB_OUTPUT
119+
echo "SBOM_DIR=./sbom" >> $GITHUB_OUTPUT
120+
121+
- name: Generate SBOM artifact
122+
run: |
123+
curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s --
124+
./bin/syft --version
125+
./bin/syft ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.tag-action.outputs.tag }} \
126+
--scope "all-layers" \
127+
--output "cyclonedx-json=${{ steps.derive-artifact-name.outputs.SBOM_DIR }}/${{ steps.derive-artifact-name.outputs.SBOM_ARTIFACT_NAME }}"
128+
129+
- name: Upload SBOM
130+
uses: actions/upload-artifact@v4
131+
with:
132+
name: ${{ steps.derive-artifact-name.outputs.SBOM_ARTIFACT_NAME }}
133+
path: ${{ steps.derive-artifact-name.outputs.SBOM_DIR }}
134+
113135
- name: Generate artifact attestation
114136
uses: actions/attest-build-provenance@v1
115137
if: (steps.tag-action.outputs.tag != '')

0 commit comments

Comments
 (0)