Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ jobs:
draft: true
generate_release_notes: true

create-sbom:
needs: [create-release]
uses: ./.github/workflows/sbom.yml
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}

build-linux:
needs:
- create-release
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/sbom.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Create SBOM files

on:
workflow_call:
inputs:
upload_url:
description: "Release assets upload URL"
required: true
type: string

jobs:
create-sbom:
runs-on: self-hosted

steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive

# Store the version, stripping any v-prefix
- name: Write release version
run: |
VERSION=${GITHUB_REF_NAME#v}
echo Version: $VERSION
echo "VERSION=$VERSION" >> $GITHUB_ENV

- name: Create SBOM with Trivy
uses: aquasecurity/trivy-action@0.33.1
with:
scan-type: 'fs'
format: 'spdx-json'
output: "defguard-client-${{ env.VERSION }}.sbom.json"
scan-ref: '.'
severity: "CRITICAL,HIGH,MEDIUM"

- name: Upload SBOM
uses: shogo82148/actions-upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: "defguard-*.sbom.json"
asset_content_type: application/octet-stream