Skip to content

Commit 6d4b0e1

Browse files
committed
Move letter-rendering schemas from standards repo
1 parent 1c16d14 commit 6d4b0e1

File tree

160 files changed

+5616
-9723
lines changed

Some content is hidden

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

160 files changed

+5616
-9723
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,6 @@ trim_trailing_whitespace = unset
2929
indent_style = unset
3030
indent_size = unset
3131
generated_code = true
32+
33+
[/cloudevents/schemas/**/*.schema.json]
34+
insert_final_newline = unset

.github/CODEOWNERS

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

33
# Notify default owners
4-
* @NHSDigital/nhs-notify-repository-template
4+
* @NHSDigital/nhs-notify-admins
55

6-
/.github/ @NHSDigital/nhs-notify-repository-template-admins
7-
*.code-workspace @NHSDigital/nhs-notify-repository-template-admins
6+
/.github/ @NHSDigital/nhs-notify-admins
7+
*.code-workspace @NHSDigital/nhs-notify-admins
88
/infrastructure/terraform/ @NHSDigital/nhs-notify-platform
99

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

1414

15-
# Each NHS Notify repository should have clear code owners set.
16-
# Do not use GitHub team names, instead use the GitHub usernames
17-
# of the people who are responsible for the code maintenance.
18-
1915
# This is a comment.
2016
# Each line is a file pattern followed by one or more owners.
2117

.github/scripts/dispatch_internal_repo_workflow.sh

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -87,59 +87,6 @@ while [[ $# -gt 0 ]]; do
8787
esac
8888
done
8989

90-
if [[ -z "$APP_PEM_FILE" ]]; then
91-
echo "[ERROR] PEM_FILE environment variable is not set or is empty."
92-
exit 1
93-
fi
94-
95-
if [[ -z "$APP_CLIENT_ID" ]]; then
96-
echo "[ERROR] CLIENT_ID environment variable is not set or is empty."
97-
exit 1
98-
fi
99-
100-
now=$(date +%s)
101-
iat=$((${now} - 60)) # Issues 60 seconds in the past
102-
exp=$((${now} + 600)) # Expires 10 minutes in the future
103-
104-
b64enc() { openssl base64 | tr -d '=' | tr '/+' '_-' | tr -d '\n'; }
105-
106-
header_json='{
107-
"typ":"JWT",
108-
"alg":"RS256"
109-
}'
110-
# Header encode
111-
header=$( echo -n "${header_json}" | b64enc )
112-
113-
payload_json="{
114-
\"iat\":${iat},
115-
\"exp\":${exp},
116-
\"iss\":\"${APP_CLIENT_ID}\"
117-
}"
118-
# Payload encode
119-
payload=$( echo -n "${payload_json}" | b64enc )
120-
121-
# Signature
122-
header_payload="${header}"."${payload}"
123-
signature=$(
124-
openssl dgst -sha256 -sign <(echo -n "${APP_PEM_FILE}") \
125-
<(echo -n "${header_payload}") | b64enc
126-
)
127-
128-
# Create JWT
129-
JWT="${header_payload}"."${signature}"
130-
131-
INSTALLATION_ID=$(curl -X GET \
132-
-H "Accept: application/vnd.github+json" \
133-
-H "Authorization: Bearer ${JWT}" \
134-
-H "X-GitHub-Api-Version: 2022-11-28" \
135-
--url "https://api.github.com/app/installations" | jq -r '.[0].id')
136-
137-
PR_TRIGGER_PAT=$(curl --request POST \
138-
--url "https://api.github.com/app/installations/${INSTALLATION_ID}/access_tokens" \
139-
-H "Accept: application/vnd.github+json" \
140-
-H "Authorization: Bearer ${JWT}" \
141-
-H "X-GitHub-Api-Version: 2022-11-28" | jq -r '.token')
142-
14390
# Set default values if not provided
14491
if [[ -z "$PR_TRIGGER_PAT" ]]; then
14592
echo "[ERROR] PR_TRIGGER_PAT environment variable is not set or is empty."

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

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ on:
1111
branches:
1212
- main
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref_name }}
16+
cancel-in-progress: false
17+
18+
permissions:
19+
id-token: write
20+
contents: read
21+
1422
jobs:
1523
metadata:
1624
name: "Set CI/CD metadata"
@@ -27,15 +35,16 @@ jobs:
2735
version: ${{ steps.variables.outputs.version }}
2836
is_version_prerelease: ${{ steps.variables.outputs.is_version_prerelease }}
2937
does_pull_request_exist: ${{ steps.pr_exists.outputs.does_pull_request_exist }}
38+
pr_number: ${{ steps.pr_exists.outputs.pr_number }}
3039
steps:
3140
- name: "Checkout code"
32-
uses: actions/checkout@v4
41+
uses: actions/checkout@v5
3342
- name: "Set CI/CD variables"
3443
id: variables
3544
run: |
3645
datetime=$(date -u +'%Y-%m-%dT%H:%M:%S%z')
3746
BUILD_DATETIME=$datetime make version-create-effective-file dir=.
38-
version=$(head -n 1 .version 2> /dev/null || echo unknown)
47+
version=$(jq -r '.version' package.json 2> /dev/null || echo unknown)
3948
echo "build_datetime_london=$(TZ=Europe/London date --date=$datetime +'%Y-%m-%dT%H:%M:%S%z')" >> $GITHUB_OUTPUT
4049
echo "build_datetime=$datetime" >> $GITHUB_OUTPUT
4150
echo "build_timestamp=$(date --date=$datetime -u +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
@@ -53,12 +62,18 @@ jobs:
5362
run: |
5463
branch_name=${GITHUB_HEAD_REF:-$(echo $GITHUB_REF | sed 's#refs/heads/##')}
5564
echo "Current branch is '$branch_name'"
56-
if gh pr list --head $branch_name | grep -q .; then
57-
echo "Pull request exists"
65+
66+
pr_json=$(gh pr list --head "$branch_name" --state open --json number --limit 1)
67+
pr_number=$(echo "$pr_json" | jq -r '.[0].number // empty')
68+
69+
if [[ -n "$pr_number" ]]; then
70+
echo "Pull request exists: #$pr_number"
5871
echo "does_pull_request_exist=true" >> $GITHUB_OUTPUT
72+
echo "pr_number=$pr_number" >> $GITHUB_OUTPUT
5973
else
6074
echo "Pull request doesn't exist"
6175
echo "does_pull_request_exist=false" >> $GITHUB_OUTPUT
76+
echo "pr_number=" >> $GITHUB_OUTPUT
6277
fi
6378
- name: "List variables"
6479
run: |

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

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,19 @@ jobs:
3737
# tag: ${{ steps.variables.outputs.tag }}
3838
steps:
3939
- name: "Checkout code"
40-
uses: actions/checkout@v4
40+
uses: actions/checkout@v5
4141
- name: "Set CI/CD variables"
4242
id: variables
4343
run: |
4444
datetime=$(date -u +'%Y-%m-%dT%H:%M:%S%z')
45+
version=$(jq -r '.version' package.json 2> /dev/null || echo unknown)
4546
echo "build_datetime=$datetime" >> $GITHUB_OUTPUT
4647
echo "build_timestamp=$(date --date=$datetime -u +'%Y%m%d%H%M%S')" >> $GITHUB_OUTPUT
4748
echo "build_epoch=$(date --date=$datetime -u +'%s')" >> $GITHUB_OUTPUT
4849
echo "nodejs_version=$(grep "^nodejs\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
4950
echo "python_version=$(grep "^python\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
5051
echo "terraform_version=$(grep "^terraform\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
51-
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" >> $GITHUB_OUTPUT
52+
echo "version=$(echo $version)" >> $GITHUB_OUTPUT
5253
# echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
5354
- name: "List variables"
5455
run: |
@@ -62,54 +63,54 @@ jobs:
6263
# export TAG="${{ steps.variables.outputs.tag }}"
6364
make list-variables
6465
65-
deploy-jekyll:
66-
environment:
67-
name: github-pages
68-
url: ${{ steps.deployment.outputs.page_url }}
69-
runs-on: ubuntu-latest
70-
needs: metadata
71-
steps:
72-
- name: "Checkout code"
73-
uses: actions/checkout@v4
74-
75-
- name: "Get version"
76-
id: get-asset-version
77-
shell: bash
78-
env:
79-
GH_TOKEN: ${{ github.token }}
80-
run: |
81-
if [[ ${{inputs.include_prereleases}} == true ]]; then
82-
json=$(gh release list --json tagName --limit 1 --exclude-drafts)
83-
else
84-
json=$(gh release list --json tagName --limit 1 --exclude-drafts --exclude-pre-releases)
85-
fi
86-
87-
echo $json
88-
89-
release_version=$(echo $json | (jq -r '.[0].tagName'))
90-
if [[ $release_version == null ]]; then exit 1; else echo $release_version; fi
91-
92-
if [[ ${{inputs.version}} == latest ]]; then
93-
echo release_version=$(echo $release_version) >> $GITHUB_OUTPUT
94-
else
95-
echo release_version=$(echo ${{inputs.version}}) >> $GITHUB_OUTPUT
96-
fi
97-
98-
- name: "Get release version"
99-
id: download-asset
100-
shell: bash
101-
env:
102-
GH_TOKEN: ${{ github.token }}
103-
run: |
104-
gh release download ${{steps.get-asset-version.outputs.release_version}} -p jekyll-docs-*.tar --output artifact.tar
105-
106-
- uses: actions/upload-artifact@v4
107-
with:
108-
name: jekyll-docs-${{steps.get-asset-version.outputs.release_version}}
109-
path: artifact.tar
110-
111-
- name: Deploy to GitHub Pages
112-
id: deployment
113-
uses: actions/deploy-pages@v4
114-
with:
115-
artifact_name: jekyll-docs-${{steps.get-asset-version.outputs.release_version}}
66+
# deploy-jekyll:
67+
# environment:
68+
# name: github-pages
69+
# url: ${{ steps.deployment.outputs.page_url }}
70+
# runs-on: ubuntu-latest
71+
# needs: metadata
72+
# steps:
73+
# - name: "Checkout code"
74+
# uses: actions/checkout@v5
75+
#
76+
# - name: "Get version"
77+
# id: get-asset-version
78+
# shell: bash
79+
# env:
80+
# GH_TOKEN: ${{ github.token }}
81+
# run: |
82+
# if [[ ${{inputs.include_prereleases}} == true ]]; then
83+
# json=$(gh release list --json tagName --limit 1 --exclude-drafts)
84+
# else
85+
# json=$(gh release list --json tagName --limit 1 --exclude-drafts --exclude-pre-releases)
86+
# fi
87+
#
88+
# echo $json
89+
#
90+
# release_version=$(echo $json | (jq -r '.[0].tagName'))
91+
# if [[ $release_version == null ]]; then exit 1; else echo $release_version; fi
92+
#
93+
# if [[ ${{inputs.version}} == latest ]]; then
94+
# echo release_version=$(echo $release_version) >> $GITHUB_OUTPUT
95+
# else
96+
# echo release_version=$(echo ${{inputs.version}}) >> $GITHUB_OUTPUT
97+
# fi
98+
#
99+
# - name: "Get release version"
100+
# id: download-asset
101+
# shell: bash
102+
# env:
103+
# GH_TOKEN: ${{ github.token }}
104+
# run: |
105+
# gh release download ${{steps.get-asset-version.outputs.release_version}} -p jekyll-docs-*.tar --output artifact.tar
106+
#
107+
# - uses: actions/upload-artifact@v4
108+
# with:
109+
# name: jekyll-docs-${{steps.get-asset-version.outputs.release_version}}
110+
# path: artifact.tar
111+
#
112+
# - name: Deploy to GitHub Pages
113+
# id: deployment
114+
# uses: actions/deploy-pages@v4
115+
# with:
116+
# artifact_name: jekyll-docs-${{steps.get-asset-version.outputs.release_version}}

.github/workflows/pr_closed.disabled

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

.github/workflows/pr_create_dynamic_env.disabled

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

0 commit comments

Comments
 (0)