.github/workflows/sbom.yaml #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
type: string | |
required: true | |
permissions: {} | |
jobs: | |
test_bom_action: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
name: Install bom and generate SBOM | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set tag name | |
shell: bash | |
run: | | |
TAG=${{ github.event.inputs.tag }} | |
echo "TAG=$TAG" >> "$GITHUB_ENV" | |
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 | |
with: | |
go-version-file: go.mod | |
check-latest: true | |
cache: true | |
- name: Install bom | |
uses: kubernetes-sigs/release-actions/setup-bom@2f8b9ec22aedc9ce15039b6c7716aa6c2907df1c # v0.2.0 | |
- name: Generate SBOM | |
shell: bash | |
run: | | |
bom generate --format=json -o /tmp/kueue-$TAG.spdx.json . | |
- name: Upload SBOM | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
shell: bash | |
run: | | |
gh release upload $TAG /tmp/kueue-$TAG.spdx.json |