A GitHub Action for setting up a .npmrc file for accessing npm repositories.
To use the GitHub Action, add the following to your job:
- uses: conventional-actions/setup-npmrc@v1
Name | Default | Description |
---|---|---|
always-auth |
false |
Set always-auth in npmrc. |
registry-url |
https://npm.pkg.github.com/ |
Registry to set up for auth. Will set the registry in a project level .npmrc file. |
scope |
${github.context.repo.owner} |
Optional scope for authenticating against scoped registries. Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/). |
token |
${github.token} |
Token to use for authenticating to the registry |
No outputs
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: conventional-actions/setup-npmrc@v1
with:
always-auth: true
registry-url: https://registry.npmjs.org/
scope: @conventional-actions
token: ${{ secrets.NPM_TOKEN }}
The scripts and documentation in this project are released under the MIT License.