-
Notifications
You must be signed in to change notification settings - Fork 17
feat: publish sbom to dtrack #767
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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 | |||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||
| 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 | |||||||||||||||||||||||||||||
|
Comment on lines
14
to
45
Check warningCode 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 AutofixAI about 2 months ago To fix this issue, add a
Suggested changeset
1
.github/workflows/dtrack-sbom.workflow.yaml
Copilot is powered by AI and may make mistakes. Always verify output.
Refresh and try again.
|
|||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The workflow subscribes only to
releaseevent typesreleasedandprereleased, so a standard release creation (publishedaction) 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 thepublishedtype so SBOMs are produced for regular release publishes.Useful? React with 👍 / 👎.