Skip to content

Trusted Publishing path: npm install -g npm@latest fails on GitHub Actions (MODULE_NOT_FOUND: promise-retry) #19

@SmarterPapa

Description

@SmarterPapa

Summary

When ioBroker/testing-action-deploy@v1 runs the Trusted Publishing / OIDC path (npm-token not set), it executes npm install -g npm@latest before npm publish. On GitHub-hosted runners (ubuntu-latest) with Node 22, that global upgrade fails with:

npm error code MODULE_NOT_FOUND
npm error Cannot find module 'promise-retry'

Adapters that need a reliable CI publish are then forced to pass npm-token, which works (that path skips the global npm upgrade) but triggers ioBroker.repochecker [W3019] (“Trusted publishing will not work while npm-token is set”).

Steps to reproduce

  1. Use a workflow whose deploy job calls ioBroker/testing-action-deploy@v1 without the npm-token input (only github-token, build, node-version, etc.).
  2. Push a version tag so the deploy job runs on ubuntu-latest.
  3. Observe failure in the “Publish package to npm” step when the action runs npm install -g npm@latest.

Evidence

Environment

  • Runner: ubuntu-latest (GitHub-hosted)
  • Node: 22.x via actions/setup-node@v4
  • Bundled npm before upgrade: 10.9.7 (typical for Node 22.22.x on Actions)
  • Action: ioBroker/testing-action-deploy@v1 (composite; publish step from action.yml on master)

Likely upstream relation

This matches broader reports of npm install -g npm@latest failing on Node 22 (missing / broken dependency resolution during self-upgrade), e.g. npm/cli #9151:
npm/cli#9151

Suggested directions (for this action)

Any approach that avoids a broken self-upgrade on GHA would unblock OIDC-only publishes and let adapters drop npm-token (clearing W3019):

  1. Optional input e.g. skip-global-npm-upgrade / npm-cli-version — when Trusted Publishing already works with the runner’s bundled npm, skip npm install -g npm@latest or pin a known-good npm version instead of @latest.
  2. Document the Node/npm matrix where the current bootstrap is known to fail, and recommend npm-token only as a temporary workaround until npm fixes the regression.
  3. Coordinate with npm if the fix belongs in the npm CLI rather than the action.

Impact

  • ioBroker adapter maintainers must choose between a failing OIDC publish or a working token publish + permanent W3019 warning in the repository checker.
  • Security / hygiene: OIDC + Trusted Publishers is preferable to long-lived tokens when it works.

Thank you for maintaining this shared action — happy to help test a fix or provide more logs if needed.


Context: ioBroker.ultrahuman maintainer; repochecker W3019 / PR discussion in ioBroker.repositories#5600.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions