diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3f78e3277..0b740dbef 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -333,8 +333,27 @@ jobs: - name: Generate git diff from upstream run: | git diff "${{ steps.upstream.outputs.commit }}" HEAD -- \ - ':!LETRO_VERSION' ':!FORK_DIVERGANCE.md' ':!UPSTREAM_VERSION' \ + ':!LETRO_VERSION' ':!FORK_DIVERGENCE.md' ':!UPSTREAM_VERSION' \ > fork-changes.diff + - name: Install Trivy + run: | + curl -sfL https://raw.githubusercontent.com/aquasecurity/trivy/main/contrib/install.sh | sh -s -- -b /usr/local/bin + + - name: Generate repository SBOM with Trivy + run: | + trivy fs \ + --format cyclonedx \ + --output sbom-repo.json \ + . + + - name: Generate image SBOM with Trivy + env: + IMAGE_DIGEST: ${{ fromJSON(needs.build-image.outputs.metadata).regular.digest }} + run: | + trivy image \ + --format cyclonedx \ + --output sbom-image.json \ + "${{ env.IMAGE }}@${IMAGE_DIGEST}" - name: Prepare a release uses: softprops/action-gh-release@v2.6.1 @@ -370,7 +389,9 @@ jobs: files: | fork-changes.diff - FORK_DIVERGANCE.md + FORK_DIVERGENCE.md + sbom-repo.json + sbom-image.json unstable: name: Update the unstable release diff --git a/FORK_DIVERGANCE.md b/FORK_DIVERGENCE.md similarity index 100% rename from FORK_DIVERGANCE.md rename to FORK_DIVERGENCE.md