File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed
.github/actions/shared-steps Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -356,6 +356,26 @@ runs:
356356 # Install ansible
357357 sudo ${{ env.runner_os == 'ubuntu' && 'apt-get' || 'dnf -q' }} -y install ansible
358358
359+ - name : Clone SBOM tools
360+ shell : bash
361+ run : |
362+ rm -rf sbom-tools
363+ git clone --depth=1 https://github.com/javihernandez/cloud-images-sbom-tools.git sbom-tools
364+
365+ - name : Set up Python and install generator deps
366+ uses : actions/setup-python@v5
367+ with :
368+ python-version : ' 3.11'
369+ cache : ' pip'
370+ cache-dependency-path : sbom-tools/requirements.txt
371+
372+ - name : Create venv and install
373+ shell : bash
374+ run : |
375+ python -m venv .venv-sbom
376+ . .venv-sbom/bin/activate
377+ pip install -r sbom-tools/requirements.txt
378+
359379 - name : Initialize packer
360380 shell : bash
361381 run : sudo /usr/bin/packer init -upgrade .
@@ -380,6 +400,18 @@ runs:
380400 echo "IMAGE_FILE=${image_file}" >> $GITHUB_ENV
381401 echo "IMAGE_NAME=$(basename ${image_file})" >> $GITHUB_ENV
382402
403+ # TODO
404+ - name : Generate SBOM
405+ shell : bash
406+ run : |
407+ . ./.venv-sbom/bin/activate
408+ mkdir -p sbom
409+ shopt -s nullglob
410+ for f in sbom-data/sbom-data*.json; do
411+ base=$(basename "$f" .json)
412+ python3 sbom-tools/sbom_generator.py "${base}" "$f" "${base}.spdx.json" -v
413+ done
414+
383415 # - name: Setup tmate session
384416 # uses: mxschmitt/action-tmate@v3
385417
Original file line number Diff line number Diff line change 11---
22cleanup_ssh_host_keys : true
3+ collect_sbom_data : true
Original file line number Diff line number Diff line change 11---
2+ - name : Include sbom_data role for SBOM data collection
3+ include_role :
4+ name : sbom_data
5+ when : collect_sbom_data | bool
6+
27- name : Remove older versions kernel and other packages
38 ansible.builtin.command : dnf -y remove --oldinstallonly
49 register : removeoldoutput
You can’t perform that action at this time.
0 commit comments