File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Generate and Sign SBOM
2+
3+ on :
4+ push :
5+ branches : [main, add-sbom-workflow]
6+ # Allows you to run this workflow manually from the Actions tab
7+ workflow_dispatch :
8+
9+ env :
10+ COMPONENT_VERSION : ${{ github.sha }}
11+
12+ jobs :
13+ sbom :
14+ runs-on : ubuntu-latest
15+ permissions :
16+ contents : read
17+
18+ steps :
19+ - name : Checkout repository
20+ uses : actions/checkout@v4
21+
22+ - name : Set up Syft
23+ uses : anchore/sbom-action@v0.20.6
24+
25+ - name : Generate SBOM with Syft
26+ run : syft . -o cyclonedx-json=sbom.${{ env.COMPONENT_VERSION }}.cdx.json
27+
28+
29+ - name : Sign SBOM
30+ uses : shiftleftcyber/secure-sbom-action@v1.2.0
31+ with :
32+ sbom_file : sbom.${{ env.COMPONENT_VERSION }}.cdx.json
33+ secure_sbom_action : sign
34+ api_key : ${{ secrets.SECURE_SBOM_API_KEY }}
35+ key_id : ${{ secrets.SECURE_SBOM_KEY_ID }}
36+
37+ - name : Archive Signed SBOM
38+ uses : actions/upload-artifact@v4
39+ with :
40+ name : secure-sbom-api-signed-sbom
41+ path : sbom.${{ env.COMPONENT_VERSION }}.cdx.signed.json
42+ retention-days : 30
43+
44+ - name : Clean up
45+ run : rm -f sbom.${{ env.COMPONENT_VERSION }}.cdx.json sbom.${{ env.COMPONENT_VERSION }}.cdx.signed.json
You can’t perform that action at this time.
0 commit comments