Skip to content

Conversation

@rolljee
Copy link
Member

@rolljee rolljee commented Dec 16, 2025

Overview

PR that add SBOM upload to our dtrack instance

rolljee and others added 7 commits December 16, 2025 16:35
Co-authored-by: Alexandre Bouthinon <bouthinon.alexandre@gmail.com>
Co-authored-by: Alexandre Bouthinon <bouthinon.alexandre@gmail.com>
feat: publish sbom to dtrack
## [7.17.0-beta.1](v7.16.0...v7.17.0-beta.1) (2025-12-16)

### Features

* publish sbom to dtrack ([09d874a](09d874a))
## [7.17.0-beta.2](v7.17.0-beta.1...v7.17.0-beta.2) (2025-12-16)

### Bug Fixes

* use custom github token to allow sequantial workflow creation ([b3109fe](b3109fe))
Comment on lines +14 to +45
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 No newline at end of file

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 7 days ago

To fix the problem, add a permissions: block explicitly specifying the minimal required permissions for the workflow's context. In most publish/read-only SBOM scenarios, contents: read is sufficient, as the job does not need to write to the repository, only to read its contents. This block can be placed at the top level (before jobs:), which will apply to all jobs in the workflow unless overridden, or just to the job in question. Since only one job is present, either position is acceptable, but placing it at the top level both makes intent clear and allows for future extensibility. The best and minimal way is to insert the following immediately after the name: line (line 1):

permissions:
  contents: read

No further changes, imports, or definitions are required.


Suggested changeset 1
.github/workflows/dtrack-sbom.workflow.yaml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/dtrack-sbom.workflow.yaml b/.github/workflows/dtrack-sbom.workflow.yaml
--- a/.github/workflows/dtrack-sbom.workflow.yaml
+++ b/.github/workflows/dtrack-sbom.workflow.yaml
@@ -1,4 +1,6 @@
 name: Dtrack SBOM publish
+permissions:
+  contents: read
 
 env:
   NODE_VERSION: "24"
EOF
@@ -1,4 +1,6 @@
name: Dtrack SBOM publish
permissions:
contents: read

env:
NODE_VERSION: "24"
Copilot is powered by AI and may make mistakes. Always verify output.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +17 to +18
- name: Checkout project
uses: actions/checkout@v6

Choose a reason for hiding this comment

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

P1 Badge Checkout step pinned to nonexistent v6 tag

The new release SBOM workflow references actions/checkout@v6, but that action is only published up to v4 in this repo’s other workflows; using an unpublished tag causes GitHub to fail the job before the repository is even checked out, so every release/prerelease event will abort before generating or uploading the SBOM.

Useful? React with 👍 / 👎.

Comment on lines +23 to +24
- name: Node version ${{ env.NODE_VERSION }}
uses: actions/setup-node@v6

Choose a reason for hiding this comment

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

P1 Badge SBOM workflow uses unsupported setup-node v6

The same workflow calls actions/setup-node@v6, while the supported tags used elsewhere in the repo are v4; GitHub will error resolving this version, preventing Node from being set up and blocking SBOM generation on every release/prerelease run.

Useful? React with 👍 / 👎.

@rolljee rolljee merged commit 27b3966 into master Dec 16, 2025
6 checks passed
@kuzzle
Copy link
Contributor

kuzzle commented Dec 16, 2025

🎉 This PR is included in version 7.17.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants