Skip to content

Commit ddb5fe1

Browse files
committed
Merge branch 'w/129.0/improvement/bump-sbom-ghaction' into tmp/octopus/q/129.0
2 parents c838b9e + 959d0c8 commit ddb5fe1

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

.github/workflows/generate-sbom.yaml

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ on:
3131

3232
jobs:
3333
generate-sbom:
34-
runs-on: ubuntu-22.04
34+
runs-on: ubuntu-24.04
3535
env:
3636
BASE_PATH: ${{ github.workspace }}/metalk8s_sbom
3737
SBOM_PATH: ${{ github.workspace }}/artifacts/sbom
@@ -49,24 +49,9 @@ jobs:
4949
- name: Create directories
5050
shell: bash
5151
run: |
52-
mkdir -p ${{ env.BASE_PATH }}/repo
5352
mkdir -p ${{ env.BASE_PATH }}/iso
5453
mkdir -p ${{ env.SBOM_PATH }}
5554
56-
- name: Checkout repo for scanning
57-
uses: actions/checkout@v4
58-
with:
59-
fetch-depth: 0
60-
fetch-tags: true
61-
ref: ${{ inputs.ref }}
62-
path: ${{ env.BASE_PATH }}/repo/metalk8s
63-
64-
- name: Generate sbom for repository
65-
uses: scality/sbom@v1.2.2
66-
with:
67-
target: ${{ env.BASE_PATH }}/repo/metalk8s
68-
output-dir: ${{ env.SBOM_PATH }}
69-
7055
- name: Get artifacts URL
7156
if: ${{ ! inputs.artifacts-url }}
7257
uses: scality/action-artifacts@v4
@@ -98,24 +83,31 @@ jobs:
9883
echo "METALK8S_VERSION=$VERSION" >> $GITHUB_ENV
9984
10085
- name: Generate sbom for extracted ISO
101-
uses: scality/sbom@v1.2.2
86+
uses: scality/sbom@v2.1.0
10287
with:
10388
target: ${{ env.BASE_PATH }}/iso/metalk8s.iso
104-
output-dir: ${{ env.SBOM_PATH }}
89+
target_type: iso
90+
output_dir: ${{ env.SBOM_PATH }}
10591
version: ${{ env.METALK8S_VERSION }}
92+
vuln: true
93+
vuln_output_format: cyclonedx-json, html
94+
merge: true
95+
merge_hierarchical: true
10696

10797
- name: Generate archive
10898
shell: bash
10999
run: |
110100
cd ${{ env.SBOM_PATH }}
111-
tar -czf sbom_metalk8s.tar.gz *.json
101+
tar -czf sbom_metalk8s.tar.gz *.json *.html
112102
113103
- name: Clean up
114104
shell: bash
115105
run: |
116-
rm -rf ${{ env.BASE_PATH }}/repo
117106
rm -rf ${{ env.BASE_PATH }}/iso
118-
rm -f ${{ env.SBOM_PATH }}/*.json
107+
find ${{ env.SBOM_PATH }} -mindepth 1 \
108+
-not -name 'sbom_metalk8s.tar.gz' \
109+
-not -name '*_merged_sbom_vuln.html' \
110+
-exec rm -rf {} +
119111
120112
- name: Generate Job result
121113
if: always()

0 commit comments

Comments
 (0)