An open API service indexing awesome lists of open source software.

https://github.com/nhsdigital/ee-utils


https://github.com/nhsdigital/ee-utils

Last synced: 5 months ago
JSON representation

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 }}
```