File tree Expand file tree Collapse file tree 2 files changed +19
-23
lines changed
Expand file tree Collapse file tree 2 files changed +19
-23
lines changed Original file line number Diff line number Diff line change @@ -118,3 +118,21 @@ jobs:
118118
119119 # Update the release with the generated notes
120120 gh release edit $TAG --title $TAG --notes "${{ steps.generate_notes.outputs.release_notes }}"
121+
122+ - name : Generate SBOM (CycloneDX)
123+ uses :
aquasecurity/[email protected] 124+ with :
125+ scan-type : ' fs'
126+ scan-ref : ' .'
127+ format : cyclonedx
128+ output : sbom.cdx.json
129+
130+ - name : Attach SBOM to release
131+ env :
132+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
133+ run : |
134+ # Get the tag being pushed
135+ TAG=${GITHUB_REF#refs/tags/}
136+
137+ # Update the release with the generated notes
138+ gh release upload $TAG sbom.cdx.json --clobber
Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - main
7- release :
8- types : [published]
97
108permissions :
119 actions : read
@@ -17,12 +15,10 @@ jobs:
1715 sbom :
1816 name : SBOM
1917 runs-on : ubuntu-22.04
20- if : github.event_name == 'push' || github.event_name == 'release'
2118 steps :
2219 - uses : actions/checkout@v4
2320
2421 - name : Generate Trivy GitHub report
25- if : github.event_name == 'push'
2622 uses :
aquasecurity/[email protected] 2723 with :
2824 scan-type : ' fs'
3228 github-pat : ${{ secrets.GITHUB_TOKEN }}
3329
3430 - name : Generate Trivy SARIF report
35- if : github.event_name == 'push'
3631 uses :
aquasecurity/[email protected] 3732 with :
3833 scan-type : ' fs'
4237 github-pat : ${{ secrets.GITHUB_TOKEN }}
4338
4439 - name : Upload SARIF
45- if : github.event_name == 'push'
4640 uses : github/codeql-action/upload-sarif@v3
4741 with :
48- sarif_file : ' trivy-results.sarif'
49-
50- - name : Generate SBOM (CycloneDX)
51- if : github.event_name == 'release'
52- uses :
aquasecurity/[email protected] 53- with :
54- scan-type : ' fs'
55- scan-ref : ' .'
56- format : cyclonedx
57- output : sbom.cdx.json
58-
59- - name : Attach SBOM to release
60- if : github.event_name == 'release'
61- env :
62- GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
63- run : |
64- gh release upload "${{ github.event.release.tag_name }}" sbom.cdx.json --clobber
42+ sarif_file : ' trivy-results.sarif'
You can’t perform that action at this time.
0 commit comments