CI/CD Instrumentation · Free Unlimited Public Repos

EU CRA Article 14 GitHub Action (Lockfiles, Syft & Trivy SBOMs)

Copy-paste GitHub Actions workflows for EU CRA Article 14 compliance using theperipetycompany/cra-switch-action@v1 (Mode A lockfile attestation and Mode B Syft / Trivy CycloneDX & SPDX SBOM upload).

1. Zero-Auth CLI Quickstart (@craswitch/cli)

Zero Login · Auto-JSON
# Zero-auth local CRA Article 14 check (auto-JSON when piped / non-TTY)
npx -y @craswitch/cli scan --json

# Fail CI only on vendor-confirmed active exploitation (4-state triage safe)
npx -y @craswitch/cli scan --fail-on-confirmed --out-dir .cra-switch --json

2. GitHub Action (cra-switch-action@v1)

Free Public Repos
# Mode A — Release-Tag Lockfile Attestation (Free for unlimited public repos)
name: EU CRA Article 14 Check
on: [push, pull_request, release]
jobs:
  cra-article-14:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: '22'
      - id: cra
        uses: theperipetycompany/cra-switch-action@v1
        with:
          fail-on-confirmed: 'true'
          out-dir: '.cra-switch'
      - uses: actions/upload-artifact@v4
        if: always()
        with:
          name: cra-sbom-vex
          path: |
            ${{ steps.cra.outputs.sbom-path }}
            ${{ steps.cra.outputs.vex-path }}

Mode B Recipe 1 — Chain anchore/sbom-action (Syft) into CRA-Switch

# Generate CycloneDX 1.6 SBOM with Syft (C/C++/Go/Docker) and upload to CRA-Switch
      - name: Generate SBOM with Syft
        uses: anchore/sbom-action@v0
        with:
          format: cyclonedx-json
          output-file: dist/app.cdx.json

      - name: Evaluate & Upload SBOM to CRA-Switch (Mode B)
        uses: theperipetycompany/cra-switch-action@v1
        with:
          sbom-path: dist/app.cdx.json
          cra-switch-url: 'https://craswitch.dev'
          sbom-api-token: ${{ secrets.CRA_SWITCH_SBOM_API_TOKEN }}
          fail-on-confirmed: 'true'

Mode B Recipe 2 — Chain aquasecurity/trivy-action (Trivy) into CRA-Switch

# Generate SPDX 2.3 SBOM with Trivy and upload to CRA-Switch
      - name: Generate SPDX 2.3 SBOM with Trivy
        uses: aquasecurity/trivy-action@0.28.0
        with:
          scan-type: fs
          format: spdx-json
          output: dist/app.spdx.json

      - name: Evaluate & Upload SPDX SBOM to CRA-Switch (Mode B)
        uses: theperipetycompany/cra-switch-action@v1
        with:
          sbom-path: dist/app.spdx.json
          cra-switch-url: 'https://craswitch.dev'
          sbom-api-token: ${{ secrets.CRA_SWITCH_SBOM_API_TOKEN }}
          fail-on-confirmed: 'true'

Mode A vs Mode B GitHub Action Inputs & Outputs

Mode / InputDefaultPurpose
Mode A (lockfile-paths)auto-discoverParses 7 lockfiles (npm, pnpm, Cargo, Go, pip, Poetry, Maven) with zero external deps
Mode B (sbom-path)""Accepts pre-built CycloneDX 1.6 or SPDX 2.3 JSON from Syft, Trivy, or Cargo Auditable
fail-on-confirmed'false' (recommended 'true')Exits 1 ONLY on vendor-confirmed active exploitation — never breaks CI on unconfirmed triage_required matches
sbom-api-token""Bearer token for POST /api/v1/sbom on Scale ($149/mo) & Organization ($399/mo) private repos
Outputstriage-state, sbom-path, vex-pathEmits CycloneDX 1.6 SBOM, OpenVEX v0.2.0, and 4-state triage summary in GITHUB_STEP_SUMMARY

Key EU CRA Article 14 Guardrails

  • 01Free forever for unlimited public GitHub repositories ($0/mo OSS tier) with live /.well-known/vex.json buyer trust portals.
  • 02Raw lockfile/SBOM KEV hits always enter triage_required (4-hour internal triage SLA) and never start the statutory 24-hour ENISA Article 14 clock without explicit maintainer confirmation.
  • 03Private repositories scale smoothly on Polar.sh fiat billing: Team $49/mo (5 private repos), Scale $149/mo (35 private repos + CI SBOM API), Organization $399/mo (unlimited private repos + 10-year Customer-Owned WORM export).