Skip to content

Commit 6f1a39b

Browse files
Add Dependency Track workflow
1 parent b741ae8 commit 6f1a39b

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Dependency Track SBOM Upload
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
workflow_dispatch:
8+
9+
jobs:
10+
dependency-track:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '18'
21+
22+
- name: Install CycloneDX
23+
run: npm install -g @cyclonedx/cyclonedx-npm
24+
25+
- name: Generate SBOM
26+
run: cyclonedx-npm --output-file bom.xml
27+
28+
- name: Upload SBOM to Dependency Track
29+
run: |
30+
curl -X POST "https://dep-tracker.laerdal.com/api/api/v1/bom" \
31+
-H "X-Api-Key: ${{ secrets.DEPENDENCY_TRACK_API_KEY }}" \
32+
-H "Content-Type: multipart/form-data" \
33+
-F "project=2d939b62-41f9-4b70-9a4e-ac9416fbe4d1" \
34+
-F "bom=@bom.xml"

0 commit comments

Comments
 (0)