Connect and configure these integrations:
- GitHub (required)
- npm Registry (optional)
-
NPM Registry
Select the npm registry from the list of available registries. If you have not already configured an npm registry, only your GitHub organizations, via the GitHub Packages npm registry, will appear in the list.
-
Triggers
Select the events that will trigger execution of the skill. You can select GitHub pushes, GitHub tags, or both.
-
npm scripts to run
Provide the name of the npm scripts from the project's
package.json
scripts section. This can be useful if you package needs compiled, tested, or otherwise transformed before being published. Only provide the name of the script, not the fullnpm run SCRIPT
command. The order in which the scripts are specified is the order in which they will get executed. If one script fails, the execution stops. Scripts are run usingnpm run --if-present SCRIPT
, so it is safe to include scripts that are only present in some of your packages. -
Node.js version
Provide a valid Node.js version or alias as used by nvm, e.g.,
12.3.1
or14
. -
Publish package
When checked, the skill will run
npm publish
after successful execution of the configured scripts. This will create the package and publish it to the configured npm registry. If not checked, the package will not be published.You must have an npm registry configured to publish packages.
-
Package access
npm publish
allows to publish packages withpublic
orrestricted
access. -
Create additional npm distribution tags
Specify additional distribution tags like
next
orstable
for the published version of the package. In addition to the tags you specify here, if the skill is running on the default branch, it adds thenext
tag. Similarly, if the skill is running on a git tag that looks like a release semantic version, thelatest
tag is added, making the published version the new default. -
Specify optional branch or tag filters
Specify one or more regular expressions to match against the branch or tag name of the skill trigger.
To limit this skill to only run on feature branches, you could use the
feature\/.*
regular expression as filter. -
Specify an optional bash command
In case your npm scripts need different tools - like databases - you can use this parameter to install such tools. Provide a command that can in a Ubuntu 20.04 LTS container. This command is after the code is checked out but before Node.js is setup or any npm commands are run.
Here is an example on how to install MongoDB and start it:
apt-get update \ && apt-get install -y wget libcurl4 openssl tar \ && wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu1804-4.2.8.tgz \ && tar -zxvf mongodb-linux-x86_64-ubuntu1804-4.2.8.tgz \ && cp mongodb-linux-x86_64-ubuntu1804-4.2.8/bin/* /usr/local/bin/ \ && rm -rf mongodb-linux-x86_64-ubuntu1804-4.2.8* \ && mkdir -p /var/lib/mongo \ && mkdir -p /var/log/mongodb \ && mongod --dbpath /var/lib/mongo --logpath /var/log/mongodb/mongod.log --fork
-
Enable file caching for faster execution times
You can speed up executions times by enabling file caching for certain artifacts — for example, dependencies — by providing glob patterns of files you'd like to cache between executions.
Note that only files within the
/atm/home
directory can be cached.Caching the npm dependency cache could be accomplished with the pattern
.npm/**/*
. -
Determine repository scope
By default, this skill will be enabled for all repositories in all organizations you have connected.
To restrict the organizations or specific repositories on which the skill will run, you can explicitly choose organizations and repositories.
-
Activate the skill
Save your configuration and activate the skill by clicking the "Enable skill" button.