This reusable GitHub Actions workflow performs quality control checks on a Node.js project by installing development
dependencies and running custom npm run qc scripts.
To include this quality check workflow in your project, call it from another workflow:
jobs:
quality-check:
uses: your-org/your-repo/.github/workflows/node-qc.yaml@v1
secrets:
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}| Name | Description |
|---|---|
PERSONAL_ACCESS_TOKEN |
GitHub Personal Access Token used for npm authentication and package installation |
- Check out the repository using
actions/checkout@v4 - Set up the Node.js environment with
panates/gh-setup-node@v1- Skips dependency installation
- Enables caching with a custom key
- Installs only development dependencies using
npm install --only=dev - Runs quality control checks via
npm run qc
- The
npm run qcscript should be defined in yourpackage.jsonand can include linters, formatters, or test runners. - Caching is enabled to speed up repeated runs.
- Dependencies are installed with
--no-saveto avoid modifyingpackage-lock.json.
This workflow is provided under the MIT License.