Skip to content

Commit ce9101b

Browse files
committed
chore(build): edit sbom on release
1 parent d910465 commit ce9101b

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

.github/workflows/build-prod.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff 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

.github/workflows/scans.yml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- main
7-
release:
8-
types: [published]
97

108
permissions:
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'
@@ -32,7 +28,6 @@ jobs:
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'
@@ -42,23 +37,6 @@ jobs:
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'

0 commit comments

Comments
 (0)