-
Notifications
You must be signed in to change notification settings - Fork 2k
41 lines (32 loc) · 1.02 KB
/
sbom.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
name: Generate SBOM with Kubernetes BOM
on:
release:
types:
- released
permissions:
contents: read
jobs:
sbom:
runs-on: ubuntu-latest
permissions:
contents: write
env:
OUTPUT: sbom.spdx
TAG: ${{ github.event.release.tag_name }}
steps:
- name: Fetch source code into GITHUB_WORKSPACE
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Install Kubernetes BOM
uses: kubernetes-sigs/release-actions/setup-bom@2f8b9ec22aedc9ce15039b6c7716aa6c2907df1c # v0.2.0
- name: Generate SBOM
run: |
bom generate \
--dirs=. \
--image=registry.k8s.io/kube-state-metrics/kube-state-metrics:$TAG \
--namespace=https://github.com/kubernetes/kube-state-metrics/releases/download/$TAG/$OUTPUT
--output=$OUTPUT
- name: Upload SBOM to GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload $TAG $OUTPUT