Skip to content

Commit cd5b621

Browse files
committed
Merge branch 'main' into feature/CCM-8125_review-supported-markdown
2 parents 795b099 + 4ed0a36 commit cd5b621

File tree

100 files changed

+2094
-826
lines changed

Some content is hidden

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

100 files changed

+2094
-826
lines changed

.github/SECURITY.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ If you wish to notify us of a vulnerability via email, please include detailed i
2121

2222
You can reach us at:
2323

24-
- _[ A product team email address ]_
25-
24+
25+
2626

2727
### NCSC
2828

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: "Check Todo usage"
2+
description: "Check Todo usage"
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: "Check Todo usage"
7+
shell: bash
8+
run: |
9+
export BRANCH_NAME=origin/${{ github.event.repository.default_branch }}
10+
check=branch ./scripts/githooks/check-todos.sh

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
3333
- name: Create Pull Request
3434
if: ${{ !env.ACT }}
35-
uses: peter-evans/[email protected].7
35+
uses: peter-evans/[email protected].8
3636
with:
3737
token: ${{ secrets.GITHUB_TOKEN }}
3838
commit-message: Drift from template

.github/workflows/scorecard.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# This workflow uses actions that are not certified by GitHub. They are provided
2+
# by a third-party and are governed by separate terms of service, privacy
3+
# policy, and support documentation.
4+
5+
name: Scorecard supply-chain security
6+
on:
7+
# For Branch-Protection check. Only the default branch is supported. See
8+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
9+
branch_protection_rule:
10+
# To guarantee Maintained check is occasionally updated. See
11+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
12+
schedule:
13+
- cron: '15 22 * * 5'
14+
push:
15+
branches: [ "main" ]
16+
17+
# Declare default permissions as read only.
18+
permissions: read-all
19+
20+
jobs:
21+
analysis:
22+
name: Scorecard analysis
23+
runs-on: ubuntu-latest
24+
permissions:
25+
# Needed to upload the results to code-scanning dashboard.
26+
security-events: write
27+
# Needed to publish results and get a badge (see publish_results below).
28+
id-token: write
29+
# Uncomment the permissions below if installing in a private repository.
30+
contents: read
31+
actions: read
32+
33+
steps:
34+
- name: "Checkout code"
35+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
36+
with:
37+
persist-credentials: false
38+
39+
- name: "Run analysis"
40+
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
41+
with:
42+
results_file: results.sarif
43+
results_format: sarif
44+
# (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
45+
# - you want to enable the Branch-Protection check on a *public* repository, or
46+
# - you are installing Scorecard on a *private* repository
47+
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
48+
repo_token: ${{ secrets.SCORECARD_TOKEN }}
49+
50+
# Public repositories:
51+
# - Publish results to OpenSSF REST API for easy access by consumers
52+
# - Allows the repository to include the Scorecard badge.
53+
# - See https://github.com/ossf/scorecard-action#publishing-results.
54+
# For private repositories:
55+
# - `publish_results` will always be set to `false`, regardless
56+
# of the value entered here.
57+
publish_results: false
58+
59+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
60+
# format to the repository Actions tab.
61+
- name: "Upload artifact"
62+
uses: actions/upload-artifact@v4
63+
with:
64+
name: SARIF file
65+
path: results.sarif
66+
retention-days: 5
67+
68+
# Upload the results to GitHub's code scanning dashboard (optional).
69+
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
70+
- name: "Upload to code-scanning"
71+
uses: github/codeql-action/upload-sarif@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
72+
with:
73+
sarif_file: results.sarif

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

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
scan-secrets:
3737
name: "Scan secrets"
3838
runs-on: ubuntu-latest
39-
timeout-minutes: 2
39+
timeout-minutes: 5
4040
steps:
4141
- name: "Checkout code"
4242
uses: actions/checkout@v4
@@ -47,7 +47,7 @@ jobs:
4747
check-file-format:
4848
name: "Check file format"
4949
runs-on: ubuntu-latest
50-
timeout-minutes: 2
50+
timeout-minutes: 5
5151
steps:
5252
- name: "Checkout code"
5353
uses: actions/checkout@v4
@@ -58,7 +58,7 @@ jobs:
5858
check-markdown-format:
5959
name: "Check Markdown format"
6060
runs-on: ubuntu-latest
61-
timeout-minutes: 2
61+
timeout-minutes: 5
6262
steps:
6363
- name: "Checkout code"
6464
uses: actions/checkout@v4
@@ -93,14 +93,25 @@ jobs:
9393
check-english-usage:
9494
name: "Check English usage"
9595
runs-on: ubuntu-latest
96-
timeout-minutes: 2
96+
timeout-minutes: 5
9797
steps:
9898
- name: "Checkout code"
9999
uses: actions/checkout@v4
100100
with:
101101
fetch-depth: 0 # Full history is needed to compare branches
102102
- name: "Check English usage"
103103
uses: ./.github/actions/check-english-usage
104+
check-todo-usage:
105+
name: "Check TODO usage"
106+
runs-on: ubuntu-latest
107+
timeout-minutes: 5
108+
steps:
109+
- name: "Checkout code"
110+
uses: actions/checkout@v4
111+
with:
112+
fetch-depth: 0 # Full history is needed to compare branches
113+
- name: "Check TODO usage"
114+
uses: ./.github/actions/check-todo-usage
104115
detect-terraform-changes:
105116
name: "Detect Terraform Changes"
106117
runs-on: ubuntu-latest
@@ -127,7 +138,7 @@ jobs:
127138
lint-terraform:
128139
name: "Lint Terraform"
129140
runs-on: ubuntu-latest
130-
timeout-minutes: 2
141+
timeout-minutes: 5
131142
needs: detect-terraform-changes
132143
if: needs.detect-terraform-changes.outputs.terraform_changed == 'true'
133144
steps:
@@ -145,7 +156,7 @@ jobs:
145156
- name: "Checkout code"
146157
uses: actions/checkout@v4
147158
- name: "Setup ASDF"
148-
uses: asdf-vm/actions/setup@v3
159+
uses: asdf-vm/actions/setup@v4
149160
- name: "Perform Setup"
150161
uses: ./.github/actions/setup
151162
- name: "Trivy Scan"
@@ -156,7 +167,7 @@ jobs:
156167
permissions:
157168
id-token: write
158169
contents: read
159-
timeout-minutes: 2
170+
timeout-minutes: 5
160171
steps:
161172
- name: "Checkout code"
162173
uses: actions/checkout@v4
@@ -175,7 +186,7 @@ jobs:
175186
permissions:
176187
id-token: write
177188
contents: read
178-
timeout-minutes: 2
189+
timeout-minutes: 5
179190
steps:
180191
- name: "Checkout code"
181192
uses: actions/checkout@v4

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ terraform 1.9.2
77
terraform-docs 0.19.0
88
trivy 0.61.0
99
vale 3.6.0
10+
# python 3.13.2
1011

1112
# ==============================================================================
1213
# The section below is reserved for Docker image versions.

LICENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MIT Licence
22

3-
Copyright (c) 2024 Crown Copyright NHS England.
3+
Copyright (c) 2025 Crown Copyright NHS England.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

frontend/src/__tests__/app/create-letter-template/page.test.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ describe('CreateLetterTemplatePage', () => {
2222
mockGetSessionServer.mockResolvedValueOnce({
2323
accessToken: 'mocktoken',
2424
clientId: 'client1',
25-
userSub: 'sub',
2625
});
2726
mockFetchClient.mockResolvedValueOnce({
2827
data: {
@@ -40,7 +39,6 @@ describe('CreateLetterTemplatePage', () => {
4039
mockGetSessionServer.mockResolvedValueOnce({
4140
accessToken: 'mocktoken',
4241
clientId: 'client1',
43-
userSub: 'sub',
4442
});
4543
mockFetchClient.mockResolvedValueOnce({
4644
data: {
@@ -61,7 +59,6 @@ describe('CreateLetterTemplatePage', () => {
6159
mockGetSessionServer.mockResolvedValueOnce({
6260
accessToken: 'mocktoken',
6361
clientId: undefined,
64-
userSub: 'sub',
6562
});
6663
mockFetchClient.mockResolvedValueOnce({
6764
data: {
@@ -84,7 +81,6 @@ describe('CreateLetterTemplatePage', () => {
8481
mockGetSessionServer.mockResolvedValueOnce({
8582
accessToken: 'mocktoken',
8683
clientId: 'client2',
87-
userSub: 'sub',
8884
});
8985
mockFetchClient.mockResolvedValueOnce({
9086
data: {

frontend/src/__tests__/app/preview-letter-template/page.test.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,7 @@ const redirectMock = jest.mocked(redirect);
2121
const getTemplateMock = jest.mocked(getTemplate);
2222

2323
const templateDTO = {
24-
id: 'template-id',
25-
templateType: 'LETTER',
26-
templateStatus: 'NOT_YET_SUBMITTED',
27-
name: 'template-name',
2824
createdAt: '2025-01-13T10:19:25.579Z',
29-
updatedAt: '2025-01-13T10:19:25.579Z',
30-
letterType: 'x0',
31-
language: 'en',
3225
files: {
3326
pdfTemplate: {
3427
fileName: 'template.pdf',
@@ -41,6 +34,13 @@ const templateDTO = {
4134
virusScanStatus: 'FAILED',
4235
},
4336
},
37+
id: 'template-id',
38+
language: 'en',
39+
letterType: 'x0',
40+
name: 'template-name',
41+
templateStatus: 'NOT_YET_SUBMITTED',
42+
templateType: 'LETTER',
43+
updatedAt: '2025-01-13T10:19:25.579Z',
4444
} satisfies TemplateDto;
4545

4646
const letterTemplate: LetterTemplate = {

frontend/src/__tests__/app/preview-submitted-letter-template/page.test.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,21 +30,21 @@ describe('PreviewSubmittedLetterTemplatePage', () => {
3030

3131
it('should load page', async () => {
3232
const templateDTO = {
33-
templateType: 'LETTER',
34-
id: 'template-id',
35-
templateStatus: 'SUBMITTED',
36-
name: 'template-name',
33+
createdAt: '2025-01-13T10:19:25.579Z',
3734
files: {
3835
pdfTemplate: {
3936
fileName: 'file.pdf',
4037
currentVersion: 'b',
4138
virusScanStatus: 'PASSED',
4239
},
4340
},
44-
createdAt: '2025-01-13T10:19:25.579Z',
45-
updatedAt: '2025-01-13T10:19:25.579Z',
46-
letterType: 'x0',
41+
id: 'template-id',
4742
language: 'en',
43+
letterType: 'x0',
44+
name: 'template-name',
45+
templateStatus: 'SUBMITTED',
46+
templateType: 'LETTER',
47+
updatedAt: '2025-01-13T10:19:25.579Z',
4848
} satisfies TemplateDto;
4949

5050
const submittedLetterTemplate: LetterTemplate = {

0 commit comments

Comments
 (0)