Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/actions/install-packages/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Install Packages
description: Install necessary packages inside the CI

runs:
using: "composite"
steps:
- run: sudo apt update && sudo apt install libunwind-dev libunwind8 -y
shell: bash
45 changes: 45 additions & 0 deletions .github/workflows/dtrack-sbom.workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Dtrack SBOM publish

env:
NODE_VERSION: "24"

on:
release:
types:
- released
- prereleased
Comment on lines +6 to +10

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Release workflow skips normal publish events

The workflow subscribes only to release event types released and prereleased, so a standard release creation (published action) never triggers this job. That means publishing a normal release will not generate or upload an SBOM, defeating the purpose of the workflow unless the release is first flagged as a prerelease and later promoted. Consider including the published type so SBOMs are produced for regular release publishes.

Useful? React with 👍 / 👎.


jobs:
publish-sbom-to-dtrack:
name: Publish SBOM to Dependency-Track
runs-on: ubuntu-24.04
steps:
- name: Checkout project
uses: actions/checkout@v6

- name: Install additional libraries
uses: ./.github/actions/install-packages

- name: Node version ${{ env.NODE_VERSION }}
uses: actions/setup-node@v6
with:
node-version: ${{ env.NODE_VERSION }}

- run: npm install
- name: Create SBOM with CycloneDX
run: npx @cyclonedx/cyclonedx-npm -o bom.xml --of=XML

- name: Get the current project version from package.json
id: get-version
run: |
echo "version=$(jq -r .version package.json)" >> $GITHUB_OUTPUT

- name: Publish SBOM to Dependency-Track
uses: DependencyTrack/gh-upload-sbom@v3
with:
serverhostname: ${{ secrets.DEPENDENCYTRACK_HOSTNAME }}
apikey: ${{ secrets.DEPENDENCYTRACK_APIKEY }}
projectname: 'Kuzzle SDK JavaScript'
projectversion: '${{ steps.get-version.outputs.version }}'
bomfilename: "./bom.xml"
autocreate: true