File tree 1 file changed +48
-0
lines changed
1 file changed +48
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Generate GitHub SBOM and Upload as Artifact
2
+
3
+ # NOTE: We would probably want to run this workflow on every push to main and not on pull requests
4
+
5
+ # on:
6
+ # push:
7
+ # branches:
8
+ # - main
9
+
10
+ on :
11
+ pull_request :
12
+ branches :
13
+ - main
14
+
15
+ jobs :
16
+ generate-sbom :
17
+ runs-on : ubuntu-latest
18
+
19
+ permissions :
20
+ contents : read
21
+ security-events : read
22
+
23
+ steps :
24
+ # Step 1: Checkout the repository
25
+ - name : Checkout repository
26
+ uses : actions/checkout@v3
27
+
28
+ # Step 2: Generate GitHub SBOM (Dependency Snapshot)
29
+ - name : Generate GitHub SBOM
30
+ id : sbom
31
+ uses : actions/dependency-review-action@v3
32
+ with :
33
+ token : ${{ secrets.GITHUB_TOKEN }}
34
+ output : sbom.json # Save as JSON file
35
+
36
+ # Step 3: Convert SBOM to CSV
37
+ - name : Convert SBOM to CSV
38
+ run : |
39
+ jq -r '.dependencies[] | [.package.name, .package.version, .relationship] | @csv' sbom.json > sbom.csv
40
+
41
+ # Step 4: Upload SBOM as GitHub Artifact
42
+ - name : Upload SBOM and CSV as Artifact
43
+ uses : actions/upload-artifact@v3
44
+ with :
45
+ name : sbom-files
46
+ path : |
47
+ sbom.json
48
+ sbom.csv
You can’t perform that action at this time.
0 commit comments