A composite action which will configure NPM to use the GitHub Packages NPM registry.
This uses npm config set
commands to set the GitHub token and scope registry for the specified scope. This updates the user profile's .npmrc
file with the GitHub token needed to talk to the GitHub Packages NPM registry.
You must have requested packages: read
(or packages:write
to publish) in your workflow.
-
GitHub App tokens can not currently be used to access a GitHub Packages NPM registry.
-
The NPM scope must match your GitHub organization name. GitHub Packages will not let you push up NPM packages for another scope.
- name: npm-config-github-packages-repository
uses: ritterim/public-github-actions/actions/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}