GitHub Package Registry as a proxy
sets up an .npmrc file that points to GPR as a proxy
Allows you to use the GitHub Package Registry as a proxy for npm operations (install, publish, etc ...) so you don't have to manually distinguish between internal dependencies registry url and public ones.
Usage
on:
push:
branches: [ master ]
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: configure npm registry proxy
uses: ahmadnassri/action-github-registry-npm-proxy@v2
with:
token: ${{ secrets.my-personal-access-token }}
scope: ${{ github.repository_owner }}
path: ${{ github.workspace }}/.npmrc
export_user_config: true
Inputs
input | required | default | description |
---|---|---|---|
token | ❌ | ${{ github.token }} |
the token to use with npm cli |
scope | ❌ | ${{ github.repository_owner }} |
the "npm scope", typically this will be your GitHub username / org name |
path | ❌ | ${{ github.workspace }}/.npmrc |
where to store the .npmrc file |
export_user_config | ❌ | false |
export the path to .npmrc as NPM_CONFIG_USERCONFIG |
proxy | ❌ | false |
enable the GitHub npm packages proxy for npm |
always_auth | ❌ | false |
set always-auth true flag |
Note: your github token should have the appropriate scopes
Author: Ahmad Nassri • Twitter: @AhmadNassri