This is a collection of util functions for the Engineering Experience team.
In order to use this package locally, you must authenticate with GitHub Packages. A number of options are given here.
The preferred method is to use a PAT token and sign in via npm login
. You must use the legacy auth-type
option as below.
This command should be run in your home directory.
npm login --scope=@NHSDigital --auth-type=legacy --registry=https://npm.pkg.github.com
You will be prompted to enter a Username and Password. The Username is your GitHub username and the Password is your PAT token.
NOTE: This PAT only needs the read:packages
scope to install packages and should be authorised via SSO to access the organisation.
To use this package in a GitHub Action, you must ensure the action has the packages: read
permission and add a few extra steps to the usual setup-node
workflow.
The registry-url
, scope
and NODE_AUTH_TOKEN
variables must be set as below. The action uses the repository's GITHUB_TOKEN
secret to authenticate with GitHub Packages. This is automatically generated by GitHub and does not need to be set manually.
You will also need to create a .npmrc
file in the root of your repository with the following contents:
@NHSDigital:registry=https://npm.pkg.github.com
NOTE: This package is currently set to private, so the repo using it must be given read access in the package settings.
- name: Install dependencies
run: make install
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}