From d060292bc30ec56dec24913c12f6c55427003fc0 Mon Sep 17 00:00:00 2001 From: Vishwanath Martur <64204611+vishwamartur@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:40:50 +0530 Subject: [PATCH] Add SBOM filter to allow image distribution Related to #40 Add post build filter to clear out generated SBOM files. * Modify `ci/yocto-check-layer.sh` to include a step that uses the `find` command to locate and delete SBOM files. * Update `ci/base.yml` to add a post build filter section that uses the `find` command to locate and delete SBOM files. * Modify `.github/workflows/build-yocto.yml` to include a step that uses the `find` command to locate and delete SBOM files after the publish image step. --- .github/workflows/build-yocto.yml | 4 ++++ ci/base.yml | 5 +++++ ci/yocto-check-layer.sh | 3 +++ 3 files changed, 12 insertions(+) mode change 100755 => 100644 ci/yocto-check-layer.sh diff --git a/.github/workflows/build-yocto.yml b/.github/workflows/build-yocto.yml index 68449d9c..ab23297b 100644 --- a/.github/workflows/build-yocto.yml +++ b/.github/workflows/build-yocto.yml @@ -94,3 +94,7 @@ jobs: (( retries == i )) && { echo 'Failed to publish artifacts'; exit 1; } echo Image available at: ${url} + + - name: Clear out the generated SBOM files + run: | + find $TOPDIR -name "*.spdx" -type f -delete diff --git a/ci/base.yml b/ci/base.yml index ef632671..afb1249e 100644 --- a/ci/base.yml +++ b/ci/base.yml @@ -31,3 +31,8 @@ local_conf_header: INHERIT += "rm_work" machine: unset + +post_build_filter: + sbom_cleanup: | + # Clear out the generated SBOM files + find $TOPDIR -name "*.spdx" -type f -delete diff --git a/ci/yocto-check-layer.sh b/ci/yocto-check-layer.sh old mode 100755 new mode 100644 index 80a2a6e8..8bad7058 --- a/ci/yocto-check-layer.sh +++ b/ci/yocto-check-layer.sh @@ -16,3 +16,6 @@ CMD="$CMD --dependency `pwd`/poky/meta `pwd`/meta-qcom" CMD="$CMD --no-auto-dependency" exec kas shell $TOPDIR/ci/base.yml --command "$CMD" + +# Clear out the generated SBOM files +find $TOPDIR -name "*.spdx" -type f -delete