https://github.com/nhsdigital/ee-utils
https://github.com/nhsdigital/ee-utils
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nhsdigital/ee-utils
- Owner: NHSDigital
- License: mit
- Archived: true
- Created: 2023-08-14T15:07:38.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-04T08:27:51.000Z (over 1 year ago)
- Last Synced: 2025-04-09T09:41:50.632Z (10 months ago)
- Language: TypeScript
- Size: 1.17 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ee-utils
This is a collection of util functions for the Engineering Experience team.
## Usage
In order to use this package locally, you must authenticate with GitHub Packages. A number of options are given [here](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-npm-registry#authenticating-to-github-packages).
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.**
```bash
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](https://docs.github.com/en/enterprise-cloud@latest/authentication/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on).
## GitHub Actions
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:
```text
@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](https://github.com/orgs/NHSDigital/packages/npm/ee-utils/settings).
```yaml
- name: Install dependencies
run: make install
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```