Skip to content

Commit 1935c5b

Browse files
authored
Merge pull request #767 from kuzzleio/7-dev
feat: publish sbom to dtrack
2 parents 4e75ae3 + 76654ad commit 1935c5b

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: Install Packages
2+
description: Install necessary packages inside the CI
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- run: sudo apt update && sudo apt install libunwind-dev libunwind8 -y
8+
shell: bash
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Dtrack SBOM publish
2+
3+
env:
4+
NODE_VERSION: "24"
5+
6+
on:
7+
release:
8+
types:
9+
- released
10+
- prereleased
11+
12+
jobs:
13+
publish-sbom-to-dtrack:
14+
name: Publish SBOM to Dependency-Track
15+
runs-on: ubuntu-24.04
16+
steps:
17+
- name: Checkout project
18+
uses: actions/checkout@v6
19+
20+
- name: Install additional libraries
21+
uses: ./.github/actions/install-packages
22+
23+
- name: Node version ${{ env.NODE_VERSION }}
24+
uses: actions/setup-node@v6
25+
with:
26+
node-version: ${{ env.NODE_VERSION }}
27+
28+
- run: npm install
29+
- name: Create SBOM with CycloneDX
30+
run: npx @cyclonedx/cyclonedx-npm -o bom.xml --of=XML
31+
32+
- name: Get the current project version from package.json
33+
id: get-version
34+
run: |
35+
echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT
36+
37+
- name: Publish SBOM to Dependency-Track
38+
uses: DependencyTrack/gh-upload-sbom@v3
39+
with:
40+
serverhostname: ${{ secrets.DEPENDENCYTRACK_HOSTNAME }}
41+
apikey: ${{ secrets.DEPENDENCYTRACK_APIKEY }}
42+
projectname: 'Kuzzle SDK JavaScript'
43+
projectversion: '${{ steps.get-version.outputs.version }}'
44+
bomfilename: "./bom.xml"
45+
autocreate: true

0 commit comments

Comments
 (0)