Skip to content

Commit 6f56fc2

Browse files
committed
Merge branch 'main' into CCM-10160_minorFixes
# Conflicts: # .github/workflows/pr_closed.yaml
2 parents ee20f88 + 2362ef7 commit 6f56fc2

File tree

239 files changed

+22431
-21906
lines changed

Some content is hidden

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

239 files changed

+22431
-21906
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/.github/ @NHSDigital/nhs-notify-supplier-api-admins
66
*.code-workspace @NHSDigital/nhs-notify-supplier-api-admins
77
/docs/ @NHSDigital/nhs-notify-supplier-api
8-
/infrastructure/terraform/ @NHSDigital/nhs-notify-platform
8+
/infrastructure/terraform/ @NHSDigital/nhs-notify-platform @NHSDigital/nhs-notify-supplier-api-admins
99

1010
# Codeowners must be final check
1111
/.github/CODEOWNERS @NHSDigital/nhs-notify-code-owners

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ runs:
1111
uses: actions/checkout@v4
1212
- uses: actions/setup-node@v4
1313
with:
14-
node-version: 18
14+
node-version: 22
1515
- name: Npm cli install
1616
working-directory: .
1717
run: npm ci

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ runs:
1111
uses: actions/checkout@v4
1212
- uses: actions/setup-node@v4
1313
with:
14-
node-version: 24
14+
node-version: 22
1515

1616
- name: Npm install
1717
working-directory: .

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ inputs:
2525
description: "Name of the Component to deploy"
2626
required: true
2727
default: 'api'
28+
nodejs_version:
29+
description: "Node.js version, set by the CI/CD pipeline workflow"
30+
required: true
2831

2932
runs:
3033
using: composite
@@ -34,7 +37,16 @@ runs:
3437
uses: actions/checkout@v4
3538
- uses: actions/setup-node@v4
3639
with:
37-
node-version: 24
40+
node-version: ${{ inputs.nodejs_version }}
41+
42+
- name: "Cache node_modules"
43+
uses: actions/cache@v4
44+
with:
45+
path: |
46+
**/node_modules
47+
key: ${{ runner.os }}-node-${{ inputs.nodejs_version }}-${{ hashFiles('**/package-lock.json') }}
48+
restore-keys: |
49+
${{ runner.os }}-node-${{ inputs.nodejs_version }}-
3850
3951
- name: Npm install
4052
working-directory: .

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ runs:
1212
uses: actions/checkout@v4
1313
- uses: actions/setup-node@v4
1414
with:
15-
node-version: 24
15+
node-version: 22
1616

1717
- name: Npm install
1818
working-directory: .

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ runs:
1111
uses: actions/checkout@v4
1212
- uses: actions/setup-node@v4
1313
with:
14-
node-version: 18
14+
node-version: 22
1515

1616
- name: Npm install
1717
working-directory: .

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ runs:
1111
uses: actions/checkout@v4
1212
- uses: actions/setup-node@v4
1313
with:
14-
node-version: 24
14+
node-version: 22
1515

1616
- name: Npm install
1717
working-directory: .

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
- uses: actions/setup-node@v6
3434
with:
35-
node-version: 24
35+
node-version: 22
3636

3737
- name: Npm install
3838
working-directory: .

.github/workflows/pr_closed.yaml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,90 @@ jobs:
6464
--terraformAction "apply" \
6565
--overrideProjectName "nhs" \
6666
--overrideRoleName "nhs-main-acct-supplier-api-github-deploy"
67+
68+
check-event-schemas-version-change:
69+
name: Check for event schemas package version change
70+
needs: check-merge-or-workflow-dispatch
71+
if: needs.check-merge-or-workflow-dispatch.outputs.deploy == 'true'
72+
outputs:
73+
version_changed: ${{ steps.check-version.outputs.version_changed }}
74+
runs-on: ubuntu-latest
75+
permissions:
76+
contents: read
77+
packages: read
78+
steps:
79+
- name: Checkout code
80+
uses: actions/[email protected]
81+
82+
- name: Setup NodeJS
83+
uses: actions/setup-node@v4
84+
with:
85+
node-version: ${{ inputs.nodejs_version }}
86+
87+
- name: check if local version differs from latest published version
88+
id: check-version
89+
run: |
90+
published_version=$(npm view @nhsdigital/nhs-notify-event-schemas-supplier-api --json 2>/dev/null | jq -r '.["dist-tags"].latest // "null"')
91+
echo "Published version: $published_version"
92+
93+
local_version=$(jq -r '.version' internal/events/package.json)
94+
echo "Local version: $local_version"
95+
96+
if [[ $local_version = $published_version ]]; then
97+
echo "Local version is the same as the latest published version - skipping publish"
98+
echo "version_changed=false" >> $GITHUB_OUTPUT
99+
else
100+
echo "Local version is different to the latest published version - publishing new version"
101+
echo "version_changed=true" >> $GITHUB_OUTPUT
102+
fi
103+
104+
test-contract:
105+
name: "Test contracts (provider)"
106+
needs: check-event-schemas-version-change
107+
if: needs.check-event-schemas-version-change.outputs.version_changed == 'true'
108+
runs-on: ubuntu-latest
109+
permissions:
110+
contents: read
111+
packages: read
112+
steps:
113+
- name: "Checkout code"
114+
uses: actions/[email protected]
115+
- name: Setup NodeJS
116+
uses: actions/setup-node@v4
117+
with:
118+
node-version: ${{ inputs.nodejs_version }}
119+
- name: "Install dependencies"
120+
run: npm ci
121+
- name: "Run provider contract tests"
122+
run: make test-contract
123+
env:
124+
GITHUB_PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125+
126+
publish-event-schemas:
127+
name: Publish event schemas package to GitHub package registry
128+
needs:
129+
- check-event-schemas-version-change
130+
- test-contract
131+
if: needs.check-event-schemas-version-change.outputs.version_changed == 'true'
132+
runs-on: ubuntu-latest
133+
permissions:
134+
contents: read
135+
packages: write
136+
137+
steps:
138+
- name: Checkout code
139+
uses: actions/[email protected]
140+
141+
- name: Setup NodeJS
142+
uses: actions/setup-node@v4
143+
with:
144+
node-version: ${{ inputs.nodejs_version }}
145+
registry-url: 'https://npm.pkg.github.com'
146+
147+
- name: Install dependencies
148+
run: npm ci
149+
150+
- name: Publish to GitHub Packages
151+
run: npm publish --workspace internal/events
152+
env:
153+
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/pr_create_dynamic_env.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)