forked from tektronix/tm_devices
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add SBOM generation and scanning workflow (tektronix#153)
* ci: Add a workflow that can perform an SBOM generation and scan. * ci: Update conditional check in SARIF upload step. * ci: Create a lockfile so that syft can read the dependencies. Signed-off-by: v12ganesh [email protected]
- Loading branch information
Showing
1 changed file
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
name: Create & Scan SBOM | ||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
release: | ||
types: [published] | ||
jobs: | ||
create-and-scan-sbom: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: x # any version | ||
- name: Create lockfile | ||
run: | | ||
pip install poetry | ||
poetry lock | ||
- name: Create SBOM | ||
uses: anchore/sbom-action@v0 | ||
with: | ||
format: spdx-json | ||
output-file: ${{ github.event.repository.name }}-sbom.spdx.json | ||
- name: Scan SBOM | ||
uses: anchore/scan-action@v3 | ||
id: scan | ||
with: | ||
sbom: ${{ github.event.repository.name }}-sbom.spdx.json | ||
fail-build: true | ||
severity-cutoff: low | ||
- name: Upload SBOM scan SARIF report | ||
if: ${{ github.event_name != 'pull_request' }} | ||
uses: github/codeql-action/upload-sarif@v3 | ||
with: | ||
sarif_file: ${{ steps.scan.outputs.sarif }} |