Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: generate sbom on release #2381

Merged
merged 4 commits into from
Jun 10, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/sbom.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Generate SBOM with Kubernetes BOM

on:
release:
types:
- published

permissions:
contents: read

jobs:
sbom:
runs-on: ubuntu-latest

permissions:
contents: write

env:
OUTPUT: kube-state-metrics-${{ github.ref_name }}.spdx
TAG: ${{ github.ref_name }}
ricardoapl marked this conversation as resolved.
Show resolved Hide resolved

steps:
- name: Fetch source code into GITHUB_WORKSPACE
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3

- name: Install Kubernetes BOM
uses: kubernetes-sigs/release-actions/setup-bom@841d76a188a7c121231a863572e27012805715a2 # v0.1.4

- name: Generate SBOM
run: |
bom generate \
--dirs=. \
--image=registry.k8s.io/kube-state-metrics/kube-state-metrics:$TAG \
ricardoapl marked this conversation as resolved.
Show resolved Hide resolved
--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