-
Notifications
You must be signed in to change notification settings - Fork 0
ci: pin npm@11 for trusted publishing, verbose publish logging #22
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
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: queso/FlowSpec
Length of output: 3719
🏁 Script executed:
Repository: queso/FlowSpec
Length of output: 2165
🌐 Web query:
npm trusted publishing minimum npm version 11.5.1 Node.js 22.14.0 official documentation💡 Result:
According to the official npm documentation, trusted publishing requires npm CLI version 11.5.1 or later and Node.js version 22.14.0 or higher [1][2]. These versions are established as the minimum requirements for the feature to function correctly [3][4]. Key implementation details regarding these requirements include: - Version Enforcement: If you use an older version of the npm CLI, the publish command will not automatically fall back to the legacy token authentication flow; instead, it will fail, often with an authentication error [3][5]. - CI/CD Configuration: Many standard cloud CI/CD runner images (such as older GitHub Actions or GitLab CI/CD environment defaults) may ship with earlier versions of npm [3][6][5]. Consequently, it is often necessary to explicitly upgrade the npm CLI within your workflow file (e.g., using npm install -g npm@latest) before running your publish command to ensure the required 11.5.1+ version is present [7][5]. - Feature Purpose: Trusted publishing uses OpenID Connect (OIDC) to authenticate your package publishing process [2][8]. This eliminates the need for long-lived npm tokens and automatically generates provenance attestations for public packages [8][9]. For organizations or users utilizing tools that automate their CI/CD, verify that the environment used for the publishing job satisfies both the npm and Node.js minimums [10][4]. If you are working within a workflow, pinning your node-version to a version that includes these dependencies or adding an explicit installation step is the recommended approach to avoid version-related failures [3][6].
Citations:
🏁 Script executed:
Repository: queso/FlowSpec
Length of output: 944
🌐 Web query:
site:github.com/actions/setup-node node-version lts/* latest LTS documentation💡 Result:
In the context of GitHub Actions, specifically within the actions/setup-node action, lts/* is a version specifier alias that instructs the action to use the latest available Long-Term Support (LTS) version of Node.js [1][2]. Important technical considerations for using lts/: 1. Default Caching Behavior: By default, the action prioritizes locally cached versions of Node.js on the runner environment to minimize workflow execution time [3]. Because these runner images are updated on a schedule, lts/ may resolve to a version that is several days (or occasionally longer) behind the most recent LTS release [4][5][3]. 2. Ensuring the Latest Version: To ensure your workflow uses the absolute latest available LTS version and bypasses the runner's local cache, you must set the check-latest input to true [4][3]. Example configuration: - uses: actions/setup-node@v4 with: node-version: lts/* check-latest: true 3. Best Practice: Official documentation and contributors note that using non-exact aliases like lts/* can lead to unpredictable delays in receiving security patches or new features [5]. For production environments or workflows where timely updates are critical, it is recommended to use a specific, pinned Node.js version (e.g., 22.17.1) rather than a dynamic alias [1][5].
Citations:
lts/*installs old LTS version intermittently actions/setup-node#940lts/*installs old LTS versions up to 1 month+ after release actions/setup-node#1236🏁 Script executed:
Repository: queso/FlowSpec
Length of output: 286
Pin the npm and Node.js versions used for trusted publishing.
npm@11andnode-version: "lts/*"select moving versions. Trusted publishing requires npm CLI11.5.1or later and Node.js22.14.0or later. Pin both versions and fail before publishing when either requirement is not met.🧰 Tools
🪛 zizmor (1.29.0)
[warning] 43-43: ad-hoc installation of packages (adhoc-packages): installs a package outside of a lockfile
(adhoc-packages)
🤖 Prompt for AI Agents
Source: Linters/SAST tools