Skip to content

Commit cf60fde

Browse files
committed
CCM-11029: rename token env var
1 parent 00ab1b2 commit cf60fde

File tree

9 files changed

+17
-15
lines changed

9 files changed

+17
-15
lines changed

.github/actions/node-modules-cache/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ runs:
4242
shell: bash
4343
run: make dependencies
4444
env:
45-
GITHUB_TOKEN: ${{ github.token }}
45+
GITHUB_PACKAGES_TOKEN: ${{ github.token }}

.github/workflows/cicd-1-pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
- name: "Check if pull request exists for this branch"
4747
id: pr_exists
4848
env:
49-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5050
run: |
5151
branch_name=${GITHUB_HEAD_REF:-$(echo $GITHUB_REF | sed 's#refs/heads/##')}
5252
echo "Current branch is '$branch_name'"

.github/workflows/pr_closed.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ jobs:
113113
- name: "Install dependencies"
114114
run: make dependencies
115115
env:
116-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
116+
GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
117117
- name: "Run provider contract tests"
118118
run: make test-contract-producer
119119

@@ -141,7 +141,7 @@ jobs:
141141
- name: Install dependencies
142142
run: make dependencies
143143
env:
144-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144+
GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145145

146146
- name: Publish to GitHub Packages
147147
run: npm publish --workspace packages/event-schemas

.github/workflows/stage-2-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ jobs:
164164
- name: "Run provider contract tests"
165165
run: make test-contract-producer
166166
env:
167-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
167+
GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
168168

169169

170170
merge-coverage:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include scripts/init.mk
88
# Example CI/CD targets are: dependencies, build, publish, deploy, clean, etc.
99

1010
dependencies: # Install dependencies needed to build and test the project @Pipeline
11-
./scripts/set_github_token.sh
11+
./scripts/set_github_packages_token.sh
1212
npm ci
1313

1414
build: # Build the project artefact @Pipeline

amplify.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ applications:
88
- cd ..
99
- nvm install 20.13.1
1010
- nvm use 20.13.1
11-
- export GITHUB_TOKEN=$(aws ssm get-parameter --name "$GITHUB_PACKAGES_READ_PAT_SSM_PARAM_NAME" --with-decryption --query Parameter.Value --output text)
12-
- ./scripts/set_github_token.sh
11+
- export GITHUB_PACKAGES_TOKEN=$(aws ssm get-parameter --name "$GITHUB_PACKAGES_READ_PAT_SSM_PARAM_NAME" --with-decryption --query Parameter.Value --output text)
12+
- ./scripts/set_github_packages_token.sh
1313
- npm ci --cache .npm --prefer-offline
1414
- npm run create-amplify-outputs env
1515
- npm run build

packages/event-schemas/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ Zod validators, TypeScript type definitions, JSON Schemas and Sample Events for
77
To install this package from GitHub package registry, you will need to configure an `.npmrc` file with the following:
88

99
```txt
10-
//npm.pkg.github.com/:_authToken=<GITHUB_TOKEN>
10+
//npm.pkg.github.com/:_authToken=<GITHUB_PACKAGES_TOKEN>
1111
@nhsdigital:registry=https://npm.pkg.github.com
1212
```
1313

14-
where `GITHUB_TOKEN` is a classic PAT with the `packages:read` scope.
14+
where `GITHUB_PACKAGES_TOKEN` is a classic PAT with the `packages:read` scope.
15+
16+
To do this run `./scripts/set_github_packages_token.sh`
1517

1618
Then run `npm install @nhsdigital/nhs-notify-event-schemas-template-management`
1719

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ npm config --location user set @nhsdigital:registry https://npm.pkg.github.com
88

99
npm config ls -l | grep '/npm.pkg.github.com/:_authToken' -q && echo "Github token already exists" && exit 0
1010

11-
if [ -z "${GITHUB_TOKEN:-}" ]; then
12-
read -p "Enter GitHub token: " GITHUB_TOKEN
13-
export GITHUB_TOKEN
11+
if [ -z "${GITHUB_PACKAGES_TOKEN:-}" ]; then
12+
read -p "Enter GitHub token: " GITHUB_PACKAGES_TOKEN
13+
export GITHUB_PACKAGES_TOKEN
1414
fi
1515

16-
npm config --location user set //npm.pkg.github.com/:_authToken $GITHUB_TOKEN
16+
npm config --location user set //npm.pkg.github.com/:_authToken $GITHUB_PACKAGES_TOKEN

scripts/tests/contract-producer.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jq '
3333
.dependencies["@nhsdigital/nhs-notify-event-schemas-template-management"] = "file:../../../packages/event-schemas"
3434
' package.json > package.json.tmp && mv package.json.tmp package.json
3535

36-
$ROOT_DIR/scripts/set_github_token.sh
36+
$ROOT_DIR/scripts/set_github_packages_token.sh
3737

3838
# Install isolated from workspace graph
3939
npm install \

0 commit comments

Comments
 (0)