Skip to content

Trusted publishing without access tokens #46

Description

@rkaminsk

Npm and pypi support trusted publishing (and probably cargo as well), which is easier to setup and safer than access tokens. I experimented a bit and this does not seem to work with reusable workflows. Is support for this on your agenda?

Pinned by ObserverOfTime

Activity

  1. ObserverOfTime commented on Oct 30, 2025

    @ObserverOfTime
    Member

    We've been looking into it.

  2. rkaminsk commented on Dec 3, 2025

    @rkaminsk
    Author

    With classic tokens to stop working soon, this becomes more of an issue: https://github.com/orgs/community/discussions/178140. At least for npm.

  3. ObserverOfTime commented on Dec 14, 2025

    @ObserverOfTime
    Member

    Try #54. I have no idea if/how you can set up a reusable workflow on the registry side.

    jobs:
      # may or may not work
      npm:
        uses: tree-sitter/workflows/.github/workflows/package-npm.yml@trusted-publishing
      # may or may not work
      crates:
        uses: tree-sitter/workflows/.github/workflows/package-crates.yml@trusted-publishing
      # definitely doesn't work
      pypi:
        uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@trusted-publishing
  4. rkaminsk commented on Dec 14, 2025

    @rkaminsk
    Author

    Thanks, I'll give it a shot when the next release is due.

  5. rkaminsk commented on Jan 13, 2026

    @rkaminsk
    Author

    I tried and it does not work. It seems like the reusable workflow does not receive githubs auth token:

    If I run npm publish directly in my workflow I get:

    Run npm publish
      npm publish
      shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
      env:
        NPM_CONFIG_USERCONFIG: /home/runner/work/_temp/.npmrc
        NODE_AUTH_TOKEN: XXXXX-XXXXX-XXXXX-XXXXX
    

    If npm publish is run via the reusable workflow there is no auth token and the process fails:

    Run npm publish
     npm publish
     shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
     env:
       NPM_CONFIG_USERCONFIG: /home/runner/work/_temp/.npmrc
       NODE_AUTH_TOKEN: 
    

    Without the auth token this is bound to fail. Not sure how to fix it. Right now, I would have to copy your workflow and adjust it manually to use with trusted publishing.

  6. sh-cho commented on May 26, 2026

    @sh-cho

    I believe we can't use trusted publishing when using reusable workflows for the moment, at least in npm/pypi.

    Don't know about crates.io but haven't seen use-case

  7. linked a pull request that will close this issuefeat: enable trusted publishing #54on Jun 30, 2026
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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions