-
Notifications
You must be signed in to change notification settings - Fork 182
54 lines (46 loc) · 1.4 KB
/
sbom.yml
File metadata and controls
54 lines (46 loc) · 1.4 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
name: SBOM Generation
on:
release:
types: [published]
workflow_dispatch:
permissions:
contents: write
id-token: write
attestations: write
jobs:
sbom:
name: Generate SBOM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Generate SBOM
uses: anchore/sbom-action@e11c554f704a0b820cbf8c51673f6945e0731532 # v0.18.0
with:
path: .
format: spdx-json
output-file: sbom.spdx.json
artifact-name: sbom-spdx
- name: Generate CycloneDX SBOM
uses: anchore/sbom-action@e11c554f704a0b820cbf8c51673f6945e0731532 # v0.18.0
with:
path: .
format: cyclonedx-json
output-file: sbom.cdx.json
artifact-name: sbom-cyclonedx
- name: Attest SBOM
if: github.event_name == 'release'
uses: actions/attest-sbom@115c3be05ff3974bcbd596578934b3f9ce39bf68 # v2.2.0
with:
subject-path: sbom.spdx.json
sbom-format: spdx+json
- name: Upload SBOMs to release
if: github.event_name == 'release'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload "${{ github.event.release.tag_name }}" \
sbom.spdx.json \
sbom.cdx.json \
--clobber