Skip to content

Commit 0fac00d

Browse files
committed
Add SBOM generation workflow
Generate SPDX and CycloneDX SBOMs on every release tag using syft, and attach them as assets to the GitHub release.
1 parent 0736070 commit 0fac00d

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

.github/workflows/release-sbom.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: release-sbom
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
7+
permissions:
8+
contents: write # needed to upload assets to the GitHub release
9+
10+
jobs:
11+
sbom:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: checkout
15+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
17+
- name: Set up Go
18+
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
19+
with:
20+
go-version: 1.26.1
21+
22+
- name: Install syft
23+
# Pin syft to a specific version. Check for new releases at https://github.com/anchore/syft/releases and bump this version periodically.
24+
run: curl -sSfL https://raw.githubusercontent.com/anchore/syft/main/install.sh | sh -s -- -b /usr/local/bin v1.18.0
25+
26+
- name: Generate SBOMs
27+
run: syft . -o spdx-json=sbom.spdx.json -o cyclonedx-json=sbom.cyclonedx.json
28+
29+
- name: Upload SBOMs to release
30+
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
31+
with:
32+
files: |
33+
sbom.spdx.json
34+
sbom.cyclonedx.json

0 commit comments

Comments
 (0)