Skip to content

[BUG] Unable to generate provenance from trusted publishing workflow #8558

Closed
npm/documentation
#1800

Description

@jrvidal

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

I am publishing a package in GitLab public runners with trusted publishing. Provenance statements are not generated.

https://www.npmjs.com/package/codemirror-lang-scheme?activeTab=versions

Expected Behavior

According to the docs, provenance should be automatically added without adding the --provenance flag.

Steps To Reproduce

I've tried in several, slightly different ways, but see the pipelines logs. In particular:

The package is (AFAIK) properly configured for trusted publishing: screenshot

Environment

  • npm: 11.5.1, 11.5.2, 11.6.0
  • Node.js: 22.x, 24.x
  • OS Name: Ubuntu

Activity

  1. added
    Bugthing that needs fixing
    Needs Triageneeds review for next steps
    on Sep 10, 2025
  2. wraithgar commented on Sep 10, 2025

    @wraithgar
    Contributor

    Thanks for submitting that docs update. I do know we had folks using gitlab in our beta program for this, so it should work. It's entirely possible our example is in error.

  3. remcohaszing commented on Nov 28, 2025

    @remcohaszing

    I used to publish with provenance from GitLab, as can be seen on https://www.npmjs.com/package/eslint-formatter-gitlab?activeTab=versions

    After switching to OIDC for version 7.0.0, the provenance is missing. You can see on https://www.npmjs.com/search?q=eslint-formatter-gitlab that this is published using OIDC. (It would be nice if the publisher is visible in the readme and versions views by the way.)

    I switched to OIDC in the following commit: https://gitlab.com/remcohaszing/eslint-formatter-gitlab/-/commit/a5b6b496009248d1f14a2f5d8edfd4920aca8762. Should I have kept the SIGSTORE_ID_TOKEN?

  4. wraithgar commented on Dec 1, 2025

    @wraithgar
    Contributor

    Asked our trusted publishing folks and got a good explanation of what's going on here:

    The issue is that when using trusted publishing, the user also need to explicitly specify the SIGSTORE_ID_TOKEN. npm requires this specific token to generate the provenance attestation with Sigstore during the publish process.
    The correct configuration should look like this:
    id_tokens:
    NPM_ID_TOKEN:
    aud: "npm:registry.npmjs.org"
    SIGSTORE_ID_TOKEN:
    aud: sigstore

    The suggestion at https://docs.npmjs.com/generating-provenance-statements#example-gitlab-ci-job has SIGSTORE_ID_TOKEN, but https://docs.npmjs.com/trusted-publishers does not.

    A PR adding SIGSTORE_ID_TOKEN to the trusted-publishers entry for gitlab would be in order here.

  5. added
    Documentationdocumentation related issue
    and removed
    Bugthing that needs fixing
    on Dec 1, 2025
  6. remcohaszing commented on Dec 4, 2025

    @remcohaszing

    I can confirm this works. I published eslint-formatter-gitlab@7.0.1 with provenance.

  7. jrvidal commented on Dec 4, 2025

    @jrvidal
    Author

    Same here 👍

  8. wraithgar commented on Dec 4, 2025

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Documentationdocumentation related issueNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions