GitHub Action for interacting with npm
Clone or download
hfaulds Merge pull request #19 from actions/hfaulds/testfix
Fix entrypoint tests and observe shell linting rules
Latest commit de7a370 Jan 18, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github add integration test Jan 17, 2019
script Initial commit Oct 16, 2018
test fix entrypoint tests Jan 17, 2019
.dockerignore Initial commit Oct 16, 2018
Brewfile Initial commit Oct 16, 2018
Dockerfile Initial commit Oct 16, 2018
LICENSE Initial commit Oct 16, 2018 Fix readme title Dec 19, 2018 Initial commit Oct 16, 2018 observeshell linting rules Jan 17, 2019

GitHub Action for NPM

This Action for npm enables arbitrary actions with the npm command-line client, including testing packages 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"

# Filter for a new tag
action "Tag" {
  needs = "Test"
  uses = "actions/bin/filter@master"
  args = "tag"

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


  • 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_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 registry other than

action "Publish" {
  uses = "actions/npm@master"
  args = "publish --access public"
  env = {
  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.