Skip to content

Configure npm

Actions
Configure npm by updating .npmrc file
v1.0.1
Latest
Star (0)

A GitHub Action for configuring npm.

# Configure credentials for npm and GitHub Packages.
- uses: nodef/[email protected]
  with:
    credentials: |-
      registry.npmjs.org=${{secrets.NPM_TOKEN}}
      npm.pkg.github.com=${{secrets.GITHUB_TOKEN}}


# Automatically configure credentials using environment variables.
# Needs $NPM_TOKEN and $GH_TOKEN/$GITHUB_TOKEN to be set.
- uses: nodef/[email protected]
  with:
    credentials: auto


# Automatically configure credentials, add a scope for GitHub Packages,
# and allow packages to be publicly visible.
- uses: nodef/[email protected]
  with:
    entries: |-
      @myorg:registry=https://npm.pkg.github.com
      access=public

Options

- uses: nodef/[email protected]
  with:
    path: $HOME/.npmrc  # Path to the .npmrc file
    reset: false        # Reset the .npmrc file
    credentials: |-     # Credentials to configure [auto]
      myregistry1=authtoken1
      myregistry2=authtoken2
      ...
    entries: |-         # Entries to add
      key1=value1
      key2=value2
      ...


References

Configure npm is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Configure npm by updating .npmrc file
v1.0.1
Latest

Configure npm is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.