STEP

Run NPM command

This NPM step allows you to run a command in the context of a git resource

Specification

command
Optional
string
A command to run.
packageFolder
Optional
string
Location of the folder containing a package.json file in its root. May be ignored depending on command.
nodeVersion
Optional
string
Optional Node.js version. If unspecified, the latest LTS version will be used (as defined by the Debian-based node:lts image). The version string can be any version installable by nvm. To use an .nvmrc file in your repository to specify a Node.js version, you must specify a nodeVersion of "auto".
flags
Optional
object
Optional flags to set before running command.
flags.tag
Optional
string
Registers the published package with the given tag, such that npm install @ will install this version.
flags.access
Optional
string
Tells the registry whether this package should be published as public or restricted. Only applies to scoped packages. If you don’t have a paid account, you must publish with public to publish scoped packages.
flags.otp
Optional
string
If you have two-factor authentication enabled in auth-and-writes mode then you can provide a code from your authenticator with this. If you don’t include this and you’re running from a TTY then you’ll be prompted.
flags.dryRun
Optional
boolean
As of npm@6, does everything publish would do except actually publishing to the registry. Reports the details of what would have been published.
git

Required

object
A map of git configuration. If you're using HTTPS, only name and repository are required.
git.ssh_key

Required

string
The SSH key to use when cloning the git repository. You can pass the key to Relay as a secret. See the example below.
git.known_hosts
Optional
string
SSH known hosts file. Use a Relay secret to pass the contents of the file into the workflow as a base64-encoded string. See the example below.
git.name

Required

string
A directory name for the git clone.
git.branch
Optional
string
The Git branch to clone.
git.repository

Required

string
The git repository URL.
npm
Optional
object
NPM credentials
npm.token
Optional
string
NPM token created via `npm token create` required by certain commands like publish.

Integrations in this step

Install the Relay CLI

Relay CLI is an essential companion for authoring and managing workflows. You can install it with a package manager or download it.
brew install puppetlabs/puppet/relay
Learn more about setting up Relay.

How to contribute

We’re excited to see and share in our community’s creation. Take a look at our community overview to learn how to begin contributing to Relay.