Skip to content

Commit

Permalink
[Actions] Updated .github/actions/sbom/action.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
credfeto committed Jan 29, 2024
1 parent 5fe723c commit 54b2483
Showing 1 changed file with 60 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/actions/sbom/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
--- # Software Bill of Materials (SBOM) Action
name: 'Run Software Bill of Materials'
description: 'Software Bill of materials'
inputs:
# GENERAL
REPO_VISIBILITY:
description: 'Visibility of the repo'
required: true

runs:
using: "composite"
steps:
- name: "Create SBOM"
shell: bash
run: echo "Create SBOM..."

- name: "Create SBOM"
uses: anchore/[email protected]
with:
format: spdx-json
output-file: "${{ github.event.repository.name }}-sbom.spdx.json"

- name: "Create SBOM"
shell: bash
run: |
echo "Output ${{ github.event.repository.name }}-sbom.spdx.json"
ls "${{ github.event.repository.name }}-sbom.spdx.json"
- name: "Scan SBOM (public Repo)"
if: inputs.REPO_VISIBILITY == 'public'
uses: anchore/[email protected]
id: sbom
with:
sbom: "${{ github.event.repository.name }}-sbom.spdx.json"
fail-build: false
output-format: sarif
only-fixed: true
add-cpes-if-none: false
by-cve: false

- name: "Copy SBOM to sarif (public Repo)"
if: |-
inputs.REPO_VISIBILITY == 'public' &&
steps.sbom.outputs.sarif != ''
shell: bash
run: |
echo "SBOM: ${{ steps.sbom.outputs.sarif }}"
cp "${{ steps.sbom.outputs.sarif }}" "${{ github.workspace }}/results/${{ github.event.repository.name }}-sbom.sarif"
cat "${{ steps.sbom.outputs.sarif }}"
- name: "Scan SBOM (private repo)"
uses: anchore/[email protected]
if: always()
with:
sbom: "${{ github.event.repository.name }}-sbom.spdx.json"
fail-build: false
output-format: table
only-fixed: true
add-cpes-if-none: false
by-cve: false

0 comments on commit 54b2483

Please sign in to comment.