Skip to content

Commit 1e4aeb8

Browse files
Merge branch 'main' into dependabot/npm_and_yarn/ts-jest-29.4.4
2 parents c2b8b8c + 07e3d65 commit 1e4aeb8

File tree

81 files changed

+2746
-600
lines changed

Some content is hidden

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

81 files changed

+2746
-600
lines changed

.devcontainer/devcontainer.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,43 @@
5959
}
6060
}
6161
},
62+
"features": {
63+
"ghcr.io/azutake/devcontainer-features/go-packages-install:0": {
64+
"PACKAGES": "github.com/asdf-vm/asdf/cmd/[email protected]"
65+
},
66+
"ghcr.io/devcontainers-extra/features/zsh-plugins:0": {
67+
"omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions.git https://github.com/zsh-users/zsh-syntax-highlighting.git",
68+
"plugins": "zsh-autosuggestions zsh-syntax-highlighting"
69+
},
70+
"ghcr.io/devcontainers/features/common-utils": {
71+
"configureZshAsDefaultShell": true,
72+
"installOhMyZsh": true,
73+
"installOhMyZshConfig": true,
74+
"installZsh": true
75+
},
76+
"ghcr.io/devcontainers/features/docker-in-docker:2": {
77+
"azureDnsAutoDetection": true,
78+
"dockerDashComposeVersion": "v2",
79+
"installDockerBuildx": true,
80+
"installDockerComposeSwitch": true,
81+
"moby": true,
82+
"version": "latest"
83+
},
84+
"ghcr.io/devcontainers/features/go:1": {},
85+
"ghcr.io/devcontainers/features/python:1": {}
86+
},
6287
"forwardPorts": [
6388
4000
6489
],
6590
"image": "ghcr.io/nhsdigital/nhs-notify-template-repository:latest",
66-
"name": "Jekyll",
91+
"mounts": [
92+
"source=${localEnv:HOME}/.gnupg,target=/home/vscode/.gnupg,type=bind,consistency=cached",
93+
"source=${localEnv:HOME}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached",
94+
"source=/usr/local/share/ca-certificates,target=/home/ca-certificates,type=bind,consistency=cached"
95+
],
96+
"name": "NHS Notify Digital Letters",
97+
"postCreateCommand": "echo 'export GPG_TTY=$TTY' | cat - ~/.zshrc > temp && mv temp ~/.zshrc && /workspaces/nhs-notify-digital-letters/scripts/devcontainer/postcreatecommand.sh",
98+
"postStartCommand": "/workspaces/nhs-notify-digital-letters/scripts/devcontainer/poststartcommand.sh",
6799
"runArgs": [
68100
"--platform=linux/amd64"
69101
]

.github/CODEOWNERS

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# NHS Notify Code Owners
22

33
# Notify default owners
4-
* @NHSDigital/nhs-notify-repository-template
4+
* @NHSDigital/nhs-notify-digital-letters
5+
/docs/
56

6-
/.github/ @NHSDigital/nhs-notify-repository-template-admins
7-
*.code-workspace @NHSDigital/nhs-notify-repository-template-admins
7+
/.github/ @NHSDigital/nhs-notify-digital-letters-admins
8+
*.code-workspace @NHSDigital/nhs-notify-digital-letters-admins
89
/infrastructure/terraform/ @NHSDigital/nhs-notify-platform
910

1011
# Codeowners must be final check
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Build Schemas"
2+
description: "build schemas"
3+
inputs:
4+
version:
5+
description: "Version number"
6+
required: true
7+
runs:
8+
using: "composite"
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: 18
15+
16+
- name: Make Config
17+
working-directory: ./schemas
18+
shell: bash
19+
run: make config
20+
21+
- name: Make Build
22+
working-directory: ./schemas
23+
shell: bash
24+
run: make build
25+
26+
- name: Upload artifact
27+
uses: actions/upload-pages-artifact@v3
28+
with:
29+
path: "schemas/output/"
30+
name: schemas-${{ inputs.version }}

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

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
does_pull_request_exist: ${{ steps.pr_exists.outputs.does_pull_request_exist }}
3030
steps:
3131
- name: "Checkout code"
32-
uses: actions/checkout@v4
32+
uses: actions/checkout@v5
3333
- name: "Set CI/CD variables"
3434
id: variables
3535
run: |
@@ -127,3 +127,18 @@ jobs:
127127
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
128128
version: "${{ needs.metadata.outputs.version }}"
129129
secrets: inherit
130+
publish-stage: # Recommended maximum execution time is 10 minutes
131+
name: "Publish stage"
132+
needs: [metadata, acceptance-stage]
133+
uses: ./.github/workflows/stage-5-publish.yaml
134+
if: (github.event_name == 'push' && github.ref == 'refs/heads/main')
135+
with:
136+
build_datetime: "${{ needs.metadata.outputs.build_datetime }}"
137+
build_timestamp: "${{ needs.metadata.outputs.build_timestamp }}"
138+
build_epoch: "${{ needs.metadata.outputs.build_epoch }}"
139+
nodejs_version: "${{ needs.metadata.outputs.nodejs_version }}"
140+
python_version: "${{ needs.metadata.outputs.python_version }}"
141+
terraform_version: "${{ needs.metadata.outputs.terraform_version }}"
142+
version: "${{ needs.metadata.outputs.version }}"
143+
is_version_prerelease: "${{ needs.metadata.outputs.is_version_prerelease }}"
144+
secrets: inherit

.github/workflows/cicd-3-deploy.yaml

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: "2. Deploy docs to GitHub Pages"
22

33
on:
4+
workflow_run:
5+
workflows: ["1. CI/CD pull request"]
6+
types:
7+
- completed
8+
branches: [main]
49
workflow_dispatch:
510
inputs:
611
include_prereleases:
@@ -15,7 +20,17 @@ on:
1520
default: latest
1621
description: "Install specific version"
1722

18-
run-name: "Include prerelease: ${{ inputs.include_prereleases }} Version: ${{ inputs.version }} by @${{ github.actor }}"
23+
run-name: >-
24+
${{ (inputs.include_prereleases != null
25+
&& inputs.version != null
26+
&& format('Triggered Manually. Include prerelease: {0} Version: {1} By: @{2}',
27+
inputs.include_prereleases,
28+
inputs.version,
29+
github.actor))
30+
|| format('Triggered by {0} ({1}). Include prerelease: true Version: latest',
31+
github.event.workflow_run.name,
32+
github.event.workflow_run.display_title) }}
33+
1934
permissions:
2035
contents: read
2136
pages: write
@@ -37,7 +52,7 @@ jobs:
3752
# tag: ${{ steps.variables.outputs.tag }}
3853
steps:
3954
- name: "Checkout code"
40-
uses: actions/checkout@v4
55+
uses: actions/checkout@v5
4156
- name: "Set CI/CD variables"
4257
id: variables
4358
run: |
@@ -70,15 +85,22 @@ jobs:
7085
needs: metadata
7186
steps:
7287
- name: "Checkout code"
73-
uses: actions/checkout@v4
88+
uses: actions/checkout@v5
7489

7590
- name: "Get version"
7691
id: get-asset-version
7792
shell: bash
7893
env:
7994
GH_TOKEN: ${{ github.token }}
8095
run: |
81-
if [[ ${{inputs.include_prereleases}} == true ]]; then
96+
INPUTS_INCLUDE_PRERELEASES=${{ inputs.include_prereleases }}
97+
INPUTS_INCLUDE_PRERELEASES=${INPUTS_INCLUDE_PRERELEASES:-"true"}
98+
99+
INPUTS_VERSION=${{ inputs.version }}
100+
INPUTS_VERSION=${INPUTS_VERSION:-"latest"}
101+
102+
103+
if [[ $INPUTS_INCLUDE_PRERELEASES == true ]]; then
82104
json=$(gh release list --json tagName --limit 1 --exclude-drafts)
83105
else
84106
json=$(gh release list --json tagName --limit 1 --exclude-drafts --exclude-pre-releases)
@@ -89,10 +111,10 @@ jobs:
89111
release_version=$(echo $json | (jq -r '.[0].tagName'))
90112
if [[ $release_version == null ]]; then exit 1; else echo $release_version; fi
91113
92-
if [[ ${{inputs.version}} == latest ]]; then
114+
if [[ $INPUTS_VERSION == latest ]]; then
93115
echo release_version=$(echo $release_version) >> $GITHUB_OUTPUT
94116
else
95-
echo release_version=$(echo ${{inputs.version}}) >> $GITHUB_OUTPUT
117+
echo release_version=$(echo $INPUTS_VERSION) >> $GITHUB_OUTPUT
96118
fi
97119
98120
- name: "Get release version"

.github/workflows/scheduled-repository-template-sync.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ jobs:
1616

1717
steps:
1818
- name: Check out the repository
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@v5
2020

2121
- name: Check out external repository
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v5
2323
with:
2424
repository: NHSDigital/nhs-notify-repository-template
2525
path: nhs-notify-repository-template

.github/workflows/scorecard.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232

3333
steps:
3434
- name: "Checkout code"
35-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
35+
uses: actions/checkout@ff7abcd0c3c05ccf6adc123a8cd1fd4fb30fb493 # v4.2.2
3636
with:
3737
persist-credentials: false
3838

@@ -68,6 +68,6 @@ jobs:
6868
# Upload the results to GitHub's code scanning dashboard (optional).
6969
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
71+
uses: github/codeql-action/upload-sarif@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7
7272
with:
7373
sarif_file: results.sarif

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
timeout-minutes: 5
4040
steps:
4141
- name: "Checkout code"
42-
uses: actions/checkout@v4
42+
uses: actions/checkout@v5
4343
with:
4444
fetch-depth: 0 # Full history is needed to scan all commits
4545
- name: "Scan secrets"
@@ -50,7 +50,7 @@ jobs:
5050
timeout-minutes: 5
5151
steps:
5252
- name: "Checkout code"
53-
uses: actions/checkout@v4
53+
uses: actions/checkout@v5
5454
with:
5555
fetch-depth: 0 # Full history is needed to compare branches
5656
- name: "Check file format"
@@ -61,7 +61,7 @@ jobs:
6161
timeout-minutes: 5
6262
steps:
6363
- name: "Checkout code"
64-
uses: actions/checkout@v4
64+
uses: actions/checkout@v5
6565
with:
6666
fetch-depth: 0 # Full history is needed to compare branches
6767
- name: "Check Markdown format"
@@ -75,7 +75,7 @@ jobs:
7575
contents: write
7676
steps:
7777
- name: "Checkout code"
78-
uses: actions/checkout@v4
78+
uses: actions/checkout@v5
7979
with:
8080
fetch-depth: 0 # Full history is needed to compare branches
8181
- name: "Check to see if Terraform Docs are up-to-date"
@@ -96,7 +96,7 @@ jobs:
9696
timeout-minutes: 5
9797
steps:
9898
- name: "Checkout code"
99-
uses: actions/checkout@v4
99+
uses: actions/checkout@v5
100100
with:
101101
fetch-depth: 0 # Full history is needed to compare branches
102102
- name: "Check English usage"
@@ -107,7 +107,7 @@ jobs:
107107
timeout-minutes: 5
108108
steps:
109109
- name: "Checkout code"
110-
uses: actions/checkout@v4
110+
uses: actions/checkout@v5
111111
with:
112112
fetch-depth: 0 # Full history is needed to compare branches
113113
- name: "Check TODO usage"
@@ -119,7 +119,7 @@ jobs:
119119
terraform_changed: ${{ steps.check.outputs.terraform_changed }}
120120
steps:
121121
- name: "Checkout code"
122-
uses: actions/checkout@v4
122+
uses: actions/checkout@v5
123123

124124
- name: "Check for Terraform changes"
125125
id: check
@@ -143,7 +143,7 @@ jobs:
143143
if: needs.detect-terraform-changes.outputs.terraform_changed == 'true'
144144
steps:
145145
- name: "Checkout code"
146-
uses: actions/checkout@v4
146+
uses: actions/checkout@v5
147147
- name: "Lint Terraform"
148148
uses: ./.github/actions/lint-terraform
149149
trivy:
@@ -154,7 +154,7 @@ jobs:
154154
if: needs.detect-terraform-changes.outputs.terraform_changed == 'true'
155155
steps:
156156
- name: "Checkout code"
157-
uses: actions/checkout@v4
157+
uses: actions/checkout@v5
158158
- name: "Setup ASDF"
159159
uses: asdf-vm/actions/setup@v4
160160
- name: "Perform Setup"
@@ -170,7 +170,7 @@ jobs:
170170
timeout-minutes: 5
171171
steps:
172172
- name: "Checkout code"
173-
uses: actions/checkout@v4
173+
uses: actions/checkout@v5
174174
- name: "Count lines of code"
175175
uses: ./.github/actions/create-lines-of-code-report
176176
with:
@@ -189,7 +189,7 @@ jobs:
189189
timeout-minutes: 5
190190
steps:
191191
- name: "Checkout code"
192-
uses: actions/checkout@v4
192+
uses: actions/checkout@v5
193193
- name: "Scan dependencies"
194194
uses: ./.github/actions/scan-dependencies
195195
with:

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
timeout-minutes: 5
4848
steps:
4949
- name: "Checkout code"
50-
uses: actions/checkout@v4
50+
uses: actions/checkout@v5
5151
- name: "Repo setup"
5252
run: |
5353
npm ci
@@ -61,7 +61,7 @@ jobs:
6161
timeout-minutes: 5
6262
steps:
6363
- name: "Checkout code"
64-
uses: actions/checkout@v4
64+
uses: actions/checkout@v5
6565
- name: "Repo setup"
6666
run: |
6767
npm ci
@@ -89,7 +89,7 @@ jobs:
8989
timeout-minutes: 5
9090
steps:
9191
- name: "Checkout code"
92-
uses: actions/checkout@v4
92+
uses: actions/checkout@v5
9393
- name: "Repo setup"
9494
run: |
9595
npm ci
@@ -105,7 +105,7 @@ jobs:
105105
timeout-minutes: 5
106106
steps:
107107
- name: "Checkout code"
108-
uses: actions/checkout@v4
108+
uses: actions/checkout@v5
109109
- name: "Repo setup"
110110
run: |
111111
npm ci
@@ -122,7 +122,7 @@ jobs:
122122
timeout-minutes: 5
123123
steps:
124124
- name: "Checkout code"
125-
uses: actions/checkout@v4
125+
uses: actions/checkout@v5
126126
- name: "Run test coverage check"
127127
run: |
128128
make test-coverage
@@ -139,7 +139,7 @@ jobs:
139139
timeout-minutes: 5
140140
steps:
141141
- name: "Checkout code"
142-
uses: actions/checkout@v4
142+
uses: actions/checkout@v5
143143
with:
144144
fetch-depth: 0 # Full history is needed to improving relevancy of reporting
145145
- name: "Download coverage report for SONAR"

0 commit comments

Comments
 (0)