Repository navigation
pnpm publish provenance from GitLab CI is rejected by npm (422): invocation.parameters missing from the SLSA v0.2 predicate #16551
Description
Verify latest release
- I verified that the issue exists in the latest pnpm release
pnpm version
12.8.1
Which area(s) of pnpm are affected? (leave empty if unsure)
CLI
Link to the code that reproduces this issue or a replay of the bug
- Failing job (public): https://gitlab.com/net.christianto/deps/qris-kit/-/jobs/16912398817
- Pipeline config at that commit: https://gitlab.com/net.christianto/deps/qris-kit/-/blob/9f19746ab776fbf547707911ab98968091c9fcb7/.gitlab-ci.yml
Reproduction steps
- Set up npm trusted publishing for a GitLab CI/CD project on npmjs.com.
- Use a GitLab CI job like this one. The image is public and ships Node.js and pnpm. Any image works if pnpm is installed with
curl -fsSL https://get.pnpm.io/install.sh | sh -.publish: image: registry.gitlab.com/net.christianto/images/node-testing:24-alpine id_tokens: NPM_ID_TOKEN: aud: "npm:registry.npmjs.org" SIGSTORE_ID_TOKEN: aud: sigstore script: - pnpm install --frozen-lockfile - pnpm -r publish --no-git-checks --registry https://registry.npmjs.org/
- Run the job on a protected branch.
pnpm prints Signed provenance statement with source and build information, then the upload fails:
ðĶ @net.christianto/emvco-mpm@0.0.2 â https://registry.npmjs.org/
Signed provenance statement with source and build information
Error: ERR_PNPM_FAILED_TO_PUBLISH
à Failed to publish package @net.christianto/emvco-mpm@0.0.2 (status 422
â Unprocessable Entity): {"success":false,"error":"Error verifying sigstore
â provenance bundle: Invalid GitLab CI SLSA v0.2 provenance predicate:
â \ninvocation.parameters.CI_PROJECT_URL: <empty> does not match expected
â value for SourceRepositoryURI: https://gitlab.com/net.christianto/deps/
â qris-kit,\ninvocation.parameters.CI_COMMIT_SHA: <empty> does not match
â expected value for SourceRepositoryDigest:
â 9f19746ab776fbf547707911ab98968091c9fcb7,
â \ninvocation.parameters.CI_PROJECT_ID: <empty> does not match expected
â value for SourceRepositoryIdentifier: 83865880,
â \ninvocation.parameters.CI_PROJECT_NAMESPACE_ID: <empty> does not match
â expected value for SourceRepositoryOwnerIdentifier: 66382978,
â \ninvocation.parameters.CI_PIPELINE_SOURCE: <empty> does not match
â expected value for BuildTrigger: push"}
Describe the Bug
gitlab_statement() in pnpm/crates/publish/src/provenance_gen.rs builds predicate.invocation with only configSource and environment. It never writes invocation.parameters.
The npm registry checks the GitLab predicate's invocation.parameters.* against the Fulcio certificate claims (CI_PROJECT_URL â SourceRepositoryURI, CI_COMMIT_SHA â SourceRepositoryDigest, CI_PROJECT_ID, CI_PROJECT_NAMESPACE_ID, CI_PIPELINE_SOURCE, âĶ). The block is missing, so every field reads as <empty> and the publish fails. The variables are set in the job; pnpm just doesn't put them in the statement.
npm's implementation, which this code appears to port, includes the block: libnpmpublish/lib/provenance.js copies a fixed list of GitLab CI variables (CI, CI_API_V4_URL, âĶ, CI_PROJECT_URL, CI_COMMIT_SHA, CI_PIPELINE_SOURCE, GITLAB_USER_LOGIN, âĶ) into invocation.parameters.
The GitHub Actions statement (SLSA v1) uses a different shape and doesn't seem affected.
Expected Behavior
The GitLab provenance statement includes predicate.invocation.parameters with the same GitLab CI variables npm's libnpmpublish emits, so the registry accepts the publish with provenance like npm publish does from the same job.
Which Node.js version are you using?
24.21.0
Which operating systems have you used?
- macOS
- Windows
- Linux
If your OS is a Linux based, which one it is? (Include the version if relevant)
Alpine Linux (registry.gitlab.com/net.christianto/images/node-testing:24-alpine, GitLab.com SaaS runner, linux-x64-musl)
Contributing a fix
- I am working on a fix
Note
LLM notice: This issue was investigated and drafted with the help of an LLM. I, the author, have reviewed the analysis, the linked source code, and the job log, and confirmed the content before submitting.
Activity
chez14 commentedon Oct 3, 2026
Uhhh... I got notification that CI/CD Error when opening this issue btw: https://github.com/pnpm/pnpm/actions/runs/37121069180
Just in case anyone interested.
fix(publish): include invocation parameters in GitLab provenance (pnpâĶ
fix(deps): update dependencias no-major (#23)