⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@ekovalets
Copy link

Description

Summary of Changes

This PR adds a new GitHub Actions workflow that will be triggered on packages change.
The trigger will generate a new SBOM.json file and if it differs from the project on will create PR.

Notes for Reviewers

Please review if this is going to work for how you handle project branches.

What is the motivation for this change?

SSDLC Improvement Goals

Double check the following

  • Lint is passing (npm run check:lint)
  • Self-review completed using the steps outlined here
  • PR title follows the correct format: type(NODE-xxxx)[!]: description
    • Example: feat(NODE-1234)!: rewriting everything in coffeescript
  • Changes are covered by tests
  • New TODOs have a related JIRA ticket

@baileympearson baileympearson changed the title ci(NODE-7025)!: New SBOM generation workflow on dependencies change ci(NODE-7025): New SBOM generation workflow on dependencies change Dec 11, 2025
@@ -0,0 +1,19 @@
name: Setup PHP SBOM
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like it was a copy-paste from the PHP implementation?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah, I was replicating structure, but missed to update the text in all places. Removed since no setup needed.

name: Setup Node SBOM
description: Sets up environment for generating SBOM in Node.js projects
inputs:
working-directory:
Copy link
Contributor

Choose a reason for hiding this comment

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

This action shouldn't be necessary because:

Copy link
Author

Choose a reason for hiding this comment

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

Removed as we use npx and direct download


permissions:
contents: write
pull-requests: write
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
pull-requests: write

I think we can remove this permission now that we're committing to main, right?

Copy link
Author

Choose a reason for hiding this comment

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

removed


concurrency:
group: sbom-${{ github.ref }}
cancel-in-progress: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
cancel-in-progress: false
cancel-in-progress: true

I definitely think we want cancel-in-progress: true (or limit concurrency to 1 execution at a time). Otherwise, it would be last action to finish wins, right?

Copy link
Author

Choose a reason for hiding this comment

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

For this one, I'd keep the false value, since it let job to finish and new job is pending, no parallel execution, and we don't terminate job in a weird state.

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, that's fine too. But then we should probably change the group to an identifier that doesn't include the git ref (which would be different for every action that runs, right?)

Comment on lines 39 to 42
- name: Load version and package info
uses: mongodb-labs/drivers-github-tools/node/get_version_info@v3
with:
npm_package_name: mongodb
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- name: Load version and package info
uses: mongodb-labs/drivers-github-tools/node/get_version_info@v3
with:
npm_package_name: mongodb

This shouldn't be necessary

Copy link
Author

Choose a reason for hiding this comment

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

Don't remember why I've added it, but I'll trust you and remove)

- name: Generate/Update package-lock.json
run: |
echo "Resolving dependencies and generating package-lock.json..."
npm install --package-lock-only
Copy link
Contributor

Choose a reason for hiding this comment

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

We've already run npm install above in mongodb-labs/drivers-github-tools/node/setup@v3. Is it necessary to only install from package-lock? If so, we might want to remove the call to the above action.

Copy link
Author

Choose a reason for hiding this comment

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

removed

@baileympearson baileympearson marked this pull request as ready for review January 16, 2026 17:50
@baileympearson baileympearson requested a review from a team as a code owner January 16, 2026 17:50
@baileympearson baileympearson self-assigned this Jan 16, 2026
@baileympearson baileympearson added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Jan 16, 2026

concurrency:
group: sbom-${{ github.ref }}
cancel-in-progress: false
Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, that's fine too. But then we should probably change the group to an identifier that doesn't include the git ref (which would be different for every action that runs, right?)

runs:
using: composite
steps:
- name: Generate SBOM
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we move the contents of this action into a standalone script? That's easier to maintain and run locally than a Github action.

Comment on lines +11 to +12
env:
SBOM_FILE: "sbom.json"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
env:
SBOM_FILE: "sbom.json"

This won't ever change, I think, so we should be able to remove it.

@@ -1,51 +1,553 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see optional dependencies included in the sbom

(any dependency in the peerDependencies section of our package.json is an optional dependency)

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

Labels

Primary Review In Review with primary reviewer, not yet ready for team's eyes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants