Skip to content

Commit d2ec0dc

Browse files
authored
Merge branch 'main' into feature/CCM-12937
2 parents 037f1e7 + 8ac8105 commit d2ec0dc

File tree

21 files changed

+181
-113
lines changed

21 files changed

+181
-113
lines changed

.github/actions/build-docs/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ inputs:
44
version:
55
description: "Version number"
66
required: true
7+
NODE_AUTH_TOKEN:
8+
description: "Token for access to github package registry"
9+
required: true
710
runs:
811
using: "composite"
912
steps:
@@ -12,8 +15,11 @@ runs:
1215
- uses: actions/setup-node@v4
1316
with:
1417
node-version: 22
18+
registry-url: 'https://npm.pkg.github.com'
1519
- name: Npm cli install
1620
working-directory: .
21+
env:
22+
NODE_AUTH_TOKEN: ${{ inputs.NODE_AUTH_TOKEN }}
1723
run: npm ci
1824
shell: bash
1925
- name: Setup Ruby

.github/actions/build-libraries/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ inputs:
44
version:
55
description: "Version number"
66
required: true
7+
NODE_AUTH_TOKEN:
8+
description: "Token for access to github package registry"
9+
required: true
710
runs:
811
using: "composite"
912
steps:
@@ -12,9 +15,12 @@ runs:
1215
- uses: actions/setup-node@v4
1316
with:
1417
node-version: 22
18+
registry-url: 'https://npm.pkg.github.com'
1519

1620
- name: Npm install
1721
working-directory: .
22+
env:
23+
NODE_AUTH_TOKEN: ${{ inputs.NODE_AUTH_TOKEN }}
1824
run: npm ci
1925
shell: bash
2026

.github/actions/build-proxies/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ inputs:
2828
nodejs_version:
2929
description: "Node.js version, set by the CI/CD pipeline workflow"
3030
required: true
31+
NODE_AUTH_TOKEN:
32+
description: "Token for access to github package registry"
33+
required: true
3134

3235
runs:
3336
using: composite
@@ -38,6 +41,7 @@ runs:
3841
- uses: actions/setup-node@v4
3942
with:
4043
node-version: ${{ inputs.nodejs_version }}
44+
registry-url: 'https://npm.pkg.github.com'
4145

4246
- name: "Cache node_modules"
4347
uses: actions/cache@v4
@@ -50,6 +54,8 @@ runs:
5054
5155
- name: Npm install
5256
working-directory: .
57+
env:
58+
NODE_AUTH_TOKEN: ${{ inputs.NODE_AUTH_TOKEN }}
5359
run: npm ci
5460
shell: bash
5561

.github/actions/build-sandbox/action.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ inputs:
44
version:
55
description: "Version number"
66
required: true
7+
8+
NODE_AUTH_TOKEN:
9+
description: "Token for access to github package registry"
10+
required: true
711
runs:
812
using: composite
913

@@ -13,9 +17,12 @@ runs:
1317
- uses: actions/setup-node@v4
1418
with:
1519
node-version: 22
20+
registry-url: 'https://npm.pkg.github.com'
1621

1722
- name: Npm install
1823
working-directory: .
24+
env:
25+
NODE_AUTH_TOKEN: ${{ inputs.NODE_AUTH_TOKEN }}
1926
run: npm ci
2027
shell: bash
2128

.github/actions/build-sdk/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ inputs:
44
version:
55
description: "Version number"
66
required: true
7+
NODE_AUTH_TOKEN:
8+
description: "Token for access to github package registry"
9+
required: true
710
runs:
811
using: "composite"
912
steps:
@@ -12,9 +15,12 @@ runs:
1215
- uses: actions/setup-node@v4
1316
with:
1417
node-version: 22
18+
registry-url: 'https://npm.pkg.github.com'
1519

1620
- name: Npm install
1721
working-directory: .
22+
env:
23+
NODE_AUTH_TOKEN: ${{ inputs.NODE_AUTH_TOKEN }}
1824
run: npm ci
1925
shell: bash
2026

.github/actions/build-server/action.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ inputs:
44
version:
55
description: "Version number"
66
required: true
7+
NODE_AUTH_TOKEN:
8+
description: "Token for access to github package registry"
9+
required: true
710
runs:
811
using: "composite"
912
steps:
@@ -12,9 +15,12 @@ runs:
1215
- uses: actions/setup-node@v4
1316
with:
1417
node-version: 22
18+
registry-url: 'https://npm.pkg.github.com'
1519

1620
- name: Npm install
1721
working-directory: .
22+
env:
23+
NODE_AUTH_TOKEN: ${{ inputs.NODE_AUTH_TOKEN }}
1824
run: npm ci
1925
shell: bash
2026

.github/workflows/manual-proxy-environment-deploy.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ on:
2121

2222
permissions:
2323
contents: read
24+
packages: read
2425

2526
jobs:
2627
deploy-environment:
@@ -36,6 +37,8 @@ jobs:
3637

3738
- name: Npm install
3839
working-directory: .
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3942
run: npm ci
4043
shell: bash
4144

@@ -87,3 +90,4 @@ jobs:
8790
runId: "${{ github.run_id }}"
8891
buildSandbox: ${{ inputs.build_sandbox }}
8992
releaseVersion: ${{ github.ref_name }}
93+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr_closed.yaml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,7 @@ jobs:
6161
--targetEnvironment "main" \
6262
--targetAccountGroup "nhs-notify-supplier-api-dev" \
6363
--targetComponent "${{ matrix.component }}" \
64-
--terraformAction "apply" \
65-
--overrideProjectName "nhs" \
66-
--overrideRoleName "nhs-main-acct-supplier-api-github-deploy"
64+
--terraformAction "apply"
6765
6866
check-event-schemas-version-change:
6967
name: Check for event schemas package version change
@@ -83,9 +81,12 @@ jobs:
8381
uses: actions/setup-node@v4
8482
with:
8583
node-version: ${{ inputs.nodejs_version }}
84+
registry-url: 'https://npm.pkg.github.com'
8685

8786
- name: check if local version differs from latest published version
8887
id: check-version
88+
env:
89+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8990
run: |
9091
published_version=$(npm view @nhsdigital/nhs-notify-event-schemas-supplier-api --json 2>/dev/null | jq -r '.["dist-tags"].latest // "null"')
9192
echo "Published version: $published_version"
@@ -116,7 +117,10 @@ jobs:
116117
uses: actions/setup-node@v4
117118
with:
118119
node-version: ${{ inputs.nodejs_version }}
120+
registry-url: 'https://npm.pkg.github.com'
119121
- name: "Install dependencies"
122+
env:
123+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120124
run: npm ci
121125
- name: "Run provider contract tests"
122126
run: make test-contract
@@ -145,6 +149,8 @@ jobs:
145149
registry-url: 'https://npm.pkg.github.com'
146150

147151
- name: Install dependencies
152+
env:
153+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
148154
run: npm ci
149155

150156
- name: Publish to GitHub Packages

.github/workflows/release_created.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,4 @@ jobs:
3737
--targetEnvironment "main" \
3838
--targetAccountGroup "nhs-notify-supplier-api-nonprod" \
3939
--targetComponent "${{ matrix.component }}" \
40-
--terraformAction "apply" \
41-
--overrideProjectName "nhs" \
42-
--overrideRoleName "nhs-main-acct-supplier-api-github-deploy"
40+
--terraformAction "apply"

.github/workflows/stage-1-commit.yaml

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -237,34 +237,6 @@ jobs:
237237
echo "Detected package version $version in main branch"
238238
echo "main_version=$version" >> $GITHUB_OUTPUT
239239
240-
# check-schemas-generated:
241-
# name: Check event schemas have been regenerated
242-
# needs: detect-event-schema-package-changes
243-
# if: needs.detect-event-schema-package-changes.outputs.changed == 'true'
244-
# runs-on: ubuntu-latest
245-
# permissions:
246-
# contents: read
247-
# steps:
248-
# - name: "Checkout code"
249-
# uses: actions/checkout@v4
250-
#
251-
# - name: "Cache node_modules"
252-
# uses: actions/cache@v4
253-
# with:
254-
# path: |
255-
# **/node_modules
256-
# key: ${{ runner.os }}-node-${{ inputs.nodejs_version }}-${{ hashFiles('**/package-lock.json') }}
257-
# restore-keys: |
258-
# ${{ runner.os }}-node-${{ inputs.nodejs_version }}-
259-
#
260-
# - name: "Re-generate schemas"
261-
# run: |
262-
# npm ci
263-
# npm --workspace internal/events run gen:jsonschema
264-
#
265-
# - name: Check for schema changes
266-
# run: git diff --quiet internal/events/schemas
267-
268240
check-schema-version-change:
269241
name: Check event schema version has been updated
270242
needs: detect-event-schema-package-changes
@@ -290,3 +262,43 @@ jobs:
290262
echo "Error: Event Schema package has changed, but new version ($local_version) is not a valid increment from latest version on main branch ($main_version)."
291263
exit 1
292264
fi
265+
266+
check-event-schemas-version-change:
267+
name: Check for event schemas package version change
268+
needs: detect-event-schema-package-changes
269+
if: needs.detect-event-schema-package-changes.outputs.changed == 'true'
270+
outputs:
271+
version_changed: ${{ steps.check-version.outputs.version_changed }}
272+
runs-on: ubuntu-latest
273+
permissions:
274+
contents: read
275+
packages: read
276+
steps:
277+
- name: Checkout code
278+
uses: actions/[email protected]
279+
280+
- name: Setup NodeJS
281+
uses: actions/setup-node@v4
282+
with:
283+
node-version: ${{ inputs.nodejs_version }}
284+
registry-url: 'https://npm.pkg.github.com'
285+
286+
- name: check if local version differs from latest published version
287+
id: check-version
288+
env:
289+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
290+
run: |
291+
published_version=$(npm view @nhsdigital/nhs-notify-event-schemas-supplier-api --json 2>/dev/null | jq -r '.["dist-tags"].latest // "null"')
292+
echo "Published version: $published_version"
293+
294+
local_version=$(jq -r '.version' internal/events/package.json)
295+
echo "Local version: $local_version"
296+
297+
if [[ $local_version = $published_version ]]; then
298+
echo "ERROR: Local version is the same as the latest published version, but event schemas have changed"
299+
echo "version_changed=false" >> $GITHUB_OUTPUT
300+
exit 1
301+
else
302+
echo "Local version is different to the latest published version - a new version will be published"
303+
echo "version_changed=true" >> $GITHUB_OUTPUT
304+
fi

0 commit comments

Comments
 (0)