You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Warning
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
NPM Worker
Actions
An action to init and manage node modules on your repo
You must include the YAML configuration file in your repository. If you do not pass its path to the config key in your workflow, the action will look for it in the directory of the workflow that triggered the action, then in .github, and finally in root (./).
Usage
1. Implement a Workflow for your action
It's a good idea to ensure the action only runs when a change to npmworker.config.yaml is made.
# ./.github/workflows/npmworker.yamlname: NPM Workeron:
push:
branches:
- master:
paths:
- .github/workflows/npmworker.config.yamljobs:
npm:
runs-on: ubuntu-latestname: NPM Workersteps:
- uses: actions/checkout@v2
- name: Workeruses: mudlabs/npm-worker@1.0.0with:
# OPTIONAL: Provide a PAT for the repository, so the# action can log activity to an issue.# Default: github.tokentoke: ${{ secrets.GITHUB_TOKEN }}# OPTIONAL: Provide a path within your repository to# the YAML configuration file.# If not provided the action will attempt to find it# before failing.config: ./path/to/npmworker.config.yaml
2. Now add the configuration file
If you want to remove a package it's not enough to remove it from the install array, you need to add it to the uninstall array.
Prop
Description
Default
clean
Specifies the action should edit the configuration file apon execution. This way every time you update the file it's a clean list of commands. Only the install, update, and uninstall arrays will be emptied, and they will be regardless of the package execution outcome.
false
issue
You may provide an issue number to track activity. If set this action will post comments to the issue detailing what has changed, whenever it runs.
path
Specifies a path from your repository root, where you would like node_modules located.
./
install
An array of npm packages you want installed.
update
An array of packages to update, or install if they are not installed.
A markdown flavourd description of the activity performed by the action. If an issue number is specified within the configuration file, this is the comment sent to that issue.
Notes
If no package.json file is located at path, the action will create one using npm init -y.
If you want the node_modules and packages to persist on your repository you will need to commit the changes. I recommend using the Add and Commit action for this.
You can not chain executions. Each array item is checked for, and broken at any instance of &&.
Each array item is executed as npm x item(i.e. npm install unirest).
NPM Worker 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
An action to init and manage node modules on your repo
NPM Worker 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.