DEV Community

Sam
Sam

Posted on • Edited on

NPM Worker

Sometimes you're working on a repo and you don't want to clone it down to your local machine, init npm, install some packages and then push it all back up.

Now there's NPM Worker. A Github Action that lets you init, install, update, and uninstall npm package on your repo. All from a single configuration file.

It also supports logging activity to an issue, so you can see what's changed from a glance.

GitHub logo mudlabs / npm-worker

Manage node packages on your Github Action repository.

Github Action   Support Mudlabs

NPM Worker

Manage node packages on your Github Action repository.

Table of Contents


Requirements

You must include the YAML configuration file in your repository. If you don't specify its path to the config key in your workflow, the action will try to find it in your .github directory and then in root (./) .

Any of the following are accepted config file names.

  • npmworker.config.yaml
  • npmworker.config.yml
  • npm.worker.config.yaml
  • npm.worker.config.yml

Usage

1. Implement a Workflow for your action

  • Here we specify the workflow should only run when a change to our config file is made.
# ./.github/workflows/npmworker.yaml
name: NPM Worker
on
  push
    branches
      - master:
    paths:
      - ./path/to/npmworker.config.yaml
jobs:
  npm:
    runs-on: ubuntu-latest
    name: NPM Worker
    steps:
      - uses: actions/checkout@v2
      - name: Worker
        uses: mudlabs/npm-worker@1.3.0
        with:
          # OPTIONAL: Provide a PAT for the repository,
Enter fullscreen mode Exit fullscreen mode

Top comments (0)