Skip to content
GitHub Action for interacting with npm (with dependencies)
Branch: master
Clone or download
Pull request Compare This branch is 6 commits ahead of actions:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

GitHub Action for NPM (with dependencies)

This Action for npm enables arbitrary actions with the npm command-line client, including testing with and publishing to a registry.


An example workflow to build, test, and publish an npm package to the default public registry follows:

workflow "Build, Test, and Publish" {
  on = "push"
  resolves = ["Publish"]

action "Build" {
  uses = "actions/npm@master"
  args = "install"

action "Test" {
  needs = "Build"
  uses = "actions/npm@master"
  args = "test"

action "E2E Tests" {
  uses = "bartlett705/npm-cy@f69478046d80aef1be0e17582c189a59bbfc9aa1"
  needs = ["Unit Tests"]
  args = "run cy:run"


  • NPM_AUTH_TOKEN - Optional. The token to use for authentication with the npm registry. Required for npm publish (more info)

Environment variables

  • NPM_REGISTRY_URL - Optional. To specify a registry to authenticate with. Defaults to
  • NPM_STRICT_SSL - Optional. Specify false if your registry is insecure and uses the http protocol. Defaults to true
  • NPM_CONFIG_USERCONFIG - Optional. To specify a non-default per-user configuration file. Defaults to $HOME/.npmrc (more info)


To authenticate with, and publish to, a secure registry other than

action "Publish" {
  uses = "actions/npm@master"
  args = "publish --access public"
  env = {
  secrets = ["NPM_AUTH_TOKEN"]

To authenticate with, and publish to, an insecure registry other than

action "Publish" {
  uses = "actions/npm@master"
  args = "publish --access public"
  env = {
    NPM_REGISTRY_URL = "my.local.registry"
    NPM_STRICT_SSL = "false"
  secrets = ["NPM_AUTH_TOKEN"]


The Dockerfile and associated scripts and documentation in this project are released under the MIT License.

Container images built with this project include third party materials. See for details.

You can’t perform that action at this time.