Skip to content

Commit 7e8533f

Browse files
committed
Merge branch 'main' into feature/CCM-12180-TestsOnPipeline
2 parents ffdf716 + 6b9c7a1 commit 7e8533f

File tree

86 files changed

+3219
-2354
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+3219
-2354
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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,12 @@ jobs:
8181
uses: actions/setup-node@v4
8282
with:
8383
node-version: ${{ inputs.nodejs_version }}
84+
registry-url: 'https://npm.pkg.github.com'
8485

8586
- name: check if local version differs from latest published version
8687
id: check-version
88+
env:
89+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8790
run: |
8891
published_version=$(npm view @nhsdigital/nhs-notify-event-schemas-supplier-api --json 2>/dev/null | jq -r '.["dist-tags"].latest // "null"')
8992
echo "Published version: $published_version"
@@ -114,7 +117,10 @@ jobs:
114117
uses: actions/setup-node@v4
115118
with:
116119
node-version: ${{ inputs.nodejs_version }}
120+
registry-url: 'https://npm.pkg.github.com'
117121
- name: "Install dependencies"
122+
env:
123+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118124
run: npm ci
119125
- name: "Run provider contract tests"
120126
run: make test-contract
@@ -143,6 +149,8 @@ jobs:
143149
registry-url: 'https://npm.pkg.github.com'
144150

145151
- name: Install dependencies
152+
env:
153+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
146154
run: npm ci
147155

148156
- name: Publish to GitHub Packages

.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

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ env:
3939
permissions:
4040
id-token: write # This is required for requesting the JWT
4141
contents: read # This is required for actions/checkout
42+
packages: read # This is required for downloading from GitHub Package Registry
4243

4344
jobs:
4445
check-generated-dependencies:
@@ -57,6 +58,8 @@ jobs:
5758
restore-keys: |
5859
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
5960
- name: "Repo setup"
61+
env:
62+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6063
run: |
6164
npm ci
6265
- name: "Generate dependencies"
@@ -79,6 +82,8 @@ jobs:
7982
restore-keys: |
8083
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
8184
- name: "Repo setup"
85+
env:
86+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8287
run: |
8388
npm ci
8489
- name: "Generate dependencies"
@@ -115,6 +120,8 @@ jobs:
115120
restore-keys: |
116121
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
117122
- name: "Repo setup"
123+
env:
124+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118125
run: |
119126
npm ci
120127
- name: "Generate dependencies"
@@ -139,6 +146,8 @@ jobs:
139146
restore-keys: |
140147
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
141148
- name: "Repo setup"
149+
env:
150+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
142151
run: |
143152
npm ci
144153
- name: "Generate dependencies"

0 commit comments

Comments
 (0)