Skip to content

[CRAVEX] SCA Integrations: Anchore #4

[CRAVEX] SCA Integrations: Anchore

[CRAVEX] SCA Integrations: Anchore #4

name: Generate SBOM with Anchore (Syft and Grype) and load into ScanCode.io
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
permissions:
contents: read
env:
IMAGE_REFERENCE: "python:3.13.0-slim"
jobs:
generate-and-load-sbom:
runs-on: ubuntu-24.04
steps:
- name: Generate CycloneDX SBOM with Anchore Syft
uses: anchore/sbom-action@v0
with:
image: ${{ env.IMAGE_REFERENCE }}
format: cyclonedx-json
output-file: "${{ github.event.repository.name }}-sbom.cdx.json"
artifact-name: "anchore-sylt-sbom.cdx.json"
upload-artifact: true
- name: Scan SBOM with Grype scanner for vulnerabilities
uses: anchore/scan-action@v6
with:
# sbom: "anchore-sylt-sbom.cdx.json"
sbom: "${{ github.event.repository.name }}-sbom.cdx.json"
output-format: cyclonedx-json
output-file: "anchore-grype-sbom.cdx.json"
fail-build: false
- name: Upload SBOM as GitHub Artifact
uses: actions/upload-artifact@v4
with:
name: anchore-grype-sbom
path: "anchore-grype-sbom.cdx.json"
retention-days: 20
- name: Import SBOM into ScanCode.io
uses: aboutcode-org/scancode-action@main
with:
pipelines: "load_sbom"
inputs-path: "anchore-sylt-sbom.cdx.json"