Conversation
Greptile SummaryThis PR fixes misconfigured npm trusted publishing by upgrading Node.js from 20 to 22 (shipping with npm 10.x, which supports OIDC-based trusted publishing), adding Key changes:
Pre-existing issue surfaced by this PR: The Confidence Score: 4/5
Important Files Changed
Reviews (1): Last reviewed commit: "fix: trusted publishing" | Re-trigger Greptile |
| - name: Publish NPM | ||
| working-directory: ${{ env.working-directory }} | ||
| run: npm publish --tarball=./infisical-sdk-${{github.ref_name}} --access public --registry=https://registry.npmjs.org/ | ||
| run: npm publish --tarball=./infisical-sdk-${{github.ref_name}} --access public |
There was a problem hiding this comment.
--tarball is not a valid npm publish flag
npm publish does not accept a --tarball flag — the tarball path is a positional argument, not a named option. Additionally, the filename pattern ./infisical-sdk-${{github.ref_name}} (e.g. ./infisical-sdk-v1.2.3) does not match what npm pack actually produces for the @infisical/cli package (which would be infisical-cli-<version>.tgz).
In practice, npm likely ignores the unrecognised --tarball option and publishes from the current ./npm working directory instead — so the workflow may still function, but not in the intended way (re-packing from source on every publish rather than using the explicitly packed tarball).
The correct form is to pass the tarball as a positional argument:
| run: npm publish --tarball=./infisical-sdk-${{github.ref_name}} --access public | |
| run: npm publish ./infisical-cli-${{ env.CLI_VERSION }}.tgz --access public |
Or, to reliably capture the exact tarball path produced by npm pack, capture its output in the Pack step:
- name: Pack NPM
working-directory: ${{ env.working-directory }}
run: echo "TARBALL=$(npm pack --json | jq -r '.[0].filename')" >> $GITHUB_ENV
- name: Publish NPM
working-directory: ${{ env.working-directory }}
run: npm publish "${{ env.TARBALL }}" --access publicNote: this bug is pre-existing and not introduced by this PR, but worth fixing while the publish step is being touched.
Description 📣
Fixed trusted publishing misconfiguration. There are a few issues:
Type ✨
Tests 🛠️