-
Notifications
You must be signed in to change notification settings - Fork 58
Add Node.js setup to SLSA generic generator workflow #285
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
base: develop
Are you sure you want to change the base?
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,93 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This workflow uses actions that are not certified by GitHub. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # They are provided by a third-party and are governed by | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # separate terms of service, privacy policy, and support | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # documentation. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This workflow lets you generate SLSA provenance file for your project. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # The generation satisfies level 3 for the provenance requirements - see https://slsa.dev/spec/v0.1/requirements | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # The project is an initiative of the OpenSSF (openssf.org) and is developed at | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # https://github.com/slsa-framework/slsa-github-generator. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # The provenance file can be verified using https://github.com/slsa-framework/slsa-verifier. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # For more information about SLSA and how it improves the supply-chain, visit slsa.dev. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: SLSA generic generator | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: - name: Setup Node.js environment | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uses: actions/setup-node@v6.2.0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| node-version: # optional | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # File containing the version Spec of the version to use. Examples: package.json, .nvmrc, .node-version, .tool-versions. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| node-version-file: # optional | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| architecture: # optional | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Set this option if you want the action to check for the latest available version that satisfies the version spec. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| check-latest: # optional | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| registry-url: # optional | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Optional scope for authenticating against scoped registries. Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| scope: # optional | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| token: # optional, default is ${{ github.server_url == 'https://github.com' && github.token || '' }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cache: # optional | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Set to false to disable automatic caching. By default, caching is enabled when either devEngines.packageManager or the top-level packageManager field in package.json specifies npm as the package manager. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| package-manager-cache: # optional, default is true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| cache-dependency-path: # optional | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Used to specify an alternative mirror to download Node.js binaries from | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mirror: # optional | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # The token used as Authorization header when fetching from the mirror | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| mirror-token: # optional | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+14
to
+41
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: - name: Setup Node.js environment | |
| uses: actions/setup-node@v6.2.0 | |
| with: | |
| # Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0. | |
| node-version: # optional | |
| # File containing the version Spec of the version to use. Examples: package.json, .nvmrc, .node-version, .tool-versions. | |
| node-version-file: # optional | |
| # Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default. | |
| architecture: # optional | |
| # Set this option if you want the action to check for the latest available version that satisfies the version spec. | |
| check-latest: # optional | |
| # Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN. | |
| registry-url: # optional | |
| # Optional scope for authenticating against scoped registries. Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/). | |
| scope: # optional | |
| # Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting. | |
| token: # optional, default is ${{ github.server_url == 'https://github.com' && github.token || '' }} | |
| # Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm. | |
| cache: # optional | |
| # Set to false to disable automatic caching. By default, caching is enabled when either devEngines.packageManager or the top-level packageManager field in package.json specifies npm as the package manager. | |
| package-manager-cache: # optional, default is true | |
| # Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies. | |
| cache-dependency-path: # optional | |
| # Used to specify an alternative mirror to download Node.js binaries from | |
| mirror: # optional | |
| # The token used as Authorization header when fetching from the mirror | |
| mirror-token: # optional | |
| on: |
Copilot
AI
Apr 8, 2026
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 build job output is wired to steps.hash.outputs.digests, but the hash step writes hashes=... to $GITHUB_OUTPUT. As written, needs.build.outputs.digests will be empty and provenance generation will fail. Align the output key names (either emit digests= or update the references to use hashes).
Copilot
AI
Apr 8, 2026
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.
base64-subjects is set to ${{ needs.build.outputs.digests }}, but the build job currently doesn't actually produce a digests output due to the output key mismatch. Once the build output key is fixed, ensure this input references the corrected output name.
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 YAML is invalid: the
on:key is immediately followed by a step definition (- name: Setup Node.js environment). Move the Node setup step underjobs.<job>.steps, and restoreon:to a proper mapping (e.g.,workflow_dispatch:andrelease:).