Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ If you wish to notify us of a vulnerability via email, please include detailed i

You can reach us at:

- _[ A product team email address ]_
- [cybersecurity@nhs.net](cybersecurity@nhs.net)
- [england.nhsnotify@nhs.net](mailto:england.nhsnotify@nhs.net)
- [cybersecurity@nhs.net](mailto:cybersecurity@nhs.net)

### NCSC

Expand Down
10 changes: 10 additions & 0 deletions .github/actions/check-todo-usage/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: "Check Todo usage"
description: "Check Todo usage"
runs:
using: "composite"
steps:
- name: "Check Todo usage"
shell: bash
run: |
export BRANCH_NAME=origin/${{ github.event.repository.default_branch }}
check=branch ./scripts/githooks/check-todos.sh
2 changes: 1 addition & 1 deletion .github/actions/create-lines-of-code-report/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ runs:
echo "secrets_exist=${{ inputs.idp_aws_report_upload_role_name != '' && inputs.idp_aws_report_upload_bucket_endpoint != '' }}" >> $GITHUB_OUTPUT
- name: "Authenticate to send the report"
if: steps.check.outputs.secrets_exist == 'true'
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ inputs.idp_aws_report_upload_account_id }}:role/${{ inputs.idp_aws_report_upload_role_name }}
aws-region: ${{ inputs.idp_aws_report_upload_region }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/scan-dependencies/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ runs:
run: echo "secrets_exist=${{ inputs.idp_aws_report_upload_role_name != '' && inputs.idp_aws_report_upload_bucket_endpoint != '' }}" >> $GITHUB_OUTPUT
- name: "Authenticate to send the reports"
if: steps.check.outputs.secrets_exist == 'true'
uses: aws-actions/configure-aws-credentials@v2
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::${{ inputs.idp_aws_report_upload_account_id }}:role/${{ inputs.idp_aws_report_upload_role_name }}
aws-region: ${{ inputs.idp_aws_report_upload_region }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/cicd-3-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ jobs:
echo "nodejs_version=$(grep "^nodejs\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
echo "python_version=$(grep "^python\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
echo "terraform_version=$(grep "^terraform\s" .tool-versions | cut -f2 -d' ')" >> $GITHUB_OUTPUT
# TODO: Get the version, but it may not be the .version file as this should come from the CI/CD Pull Request Workflow
echo "version=$(head -n 1 .version 2> /dev/null || echo unknown)" >> $GITHUB_OUTPUT
# echo "tag=${{ github.event.inputs.tag }}" >> $GITHUB_OUTPUT
- name: "List variables"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:

- name: Run syncronisation script
run: |
./scripts/githooks/sync-template-repo.sh
./nhs-notify-repository-template/scripts/githooks/sync-template-repo.sh
rm -Rf ./nhs-notify-repository-template

- name: Create Pull Request
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ jobs:
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read
contents: read
actions: read

steps:
- name: "Checkout code"
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false

Expand All @@ -45,7 +45,7 @@ jobs:
# - you want to enable the Branch-Protection check on a *public* repository, or
# - you are installing Scorecard on a *private* repository
# To create the PAT, follow the steps in https://github.com/ossf/scorecard-action?tab=readme-ov-file#authentication-with-fine-grained-pat-optional.
# repo_token: ${{ secrets.SCORECARD_TOKEN }}
repo_token: ${{ secrets.SCORECARD_TOKEN }}

# Public repositories:
# - Publish results to OpenSSF REST API for easy access by consumers
Expand All @@ -59,7 +59,7 @@ jobs:
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@97a0fba1372883ab732affbe8f94b823f91727db # v3.pre.node20
uses: actions/upload-artifact@v4
with:
name: SARIF file
path: results.sarif
Expand All @@ -68,6 +68,6 @@ jobs:
# Upload the results to GitHub's code scanning dashboard (optional).
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@60168efe1c415ce0f5521ea06d5c2062adbeed1b # v3.28.17
uses: github/codeql-action/upload-sarif@fca7ace96b7d713c7035871441bd52efbe39e27e # v3.28.19
with:
sarif_file: results.sarif
27 changes: 19 additions & 8 deletions .github/workflows/stage-1-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
scan-secrets:
name: "Scan secrets"
runs-on: ubuntu-latest
timeout-minutes: 2
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v4
Expand All @@ -47,7 +47,7 @@
check-file-format:
name: "Check file format"
runs-on: ubuntu-latest
timeout-minutes: 2
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v4
Expand All @@ -58,7 +58,7 @@
check-markdown-format:
name: "Check Markdown format"
runs-on: ubuntu-latest
timeout-minutes: 2
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v4
Expand Down Expand Up @@ -93,15 +93,26 @@
check-english-usage:
name: "Check English usage"
runs-on: ubuntu-latest
timeout-minutes: 2
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history is needed to compare branches
- name: "Check English usage"
uses: ./.github/actions/check-english-usage
check-todo-usage:
name: "Check TODO usage"
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history is needed to compare branches
- name: "Check TODO usage"
uses: ./.github/actions/check-todo-usage
detect-terraform-changes:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
name: "Detect Terraform Changes"
runs-on: ubuntu-latest
outputs:
Expand All @@ -127,7 +138,7 @@
lint-terraform:
name: "Lint Terraform"
runs-on: ubuntu-latest
timeout-minutes: 2
timeout-minutes: 5
needs: detect-terraform-changes
if: needs.detect-terraform-changes.outputs.terraform_changed == 'true'
steps:
Expand All @@ -145,7 +156,7 @@
- name: "Checkout code"
uses: actions/checkout@v4
- name: "Setup ASDF"
uses: asdf-vm/actions/setup@v3
uses: asdf-vm/actions/setup@v4
- name: "Perform Setup"
uses: ./.github/actions/setup
- name: "Trivy Scan"
Expand All @@ -156,7 +167,7 @@
permissions:
id-token: write
contents: read
timeout-minutes: 2
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v4
Expand All @@ -175,7 +186,7 @@
permissions:
id-token: write
contents: read
timeout-minutes: 2
timeout-minutes: 5
steps:
- name: "Checkout code"
uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stage-3-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: "Upload artefact 1"
run: |
echo "Uploading artefact 1 ..."
# TODO: Use either action/cache or action/upload-artifact
# Use either action/cache or action/upload-artifact
artefact-n:
name: "Artefact n"
runs-on: ubuntu-latest
Expand All @@ -77,4 +77,4 @@ jobs:
- name: "Upload artefact n"
run: |
echo "Uploading artefact n ..."
# TODO: Use either action/cache or action/upload-artifact
# Use either action/cache or action/upload-artifact
12 changes: 11 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@
version.json
*.code-workspace
!project.code-workspace
node_modules

# Please, add your custom content below!

# dependencies
node_modules
.node-version
*/node_modules
/.pnp
.pnp.js
/build
dist
.DS_Store
.reports
14 changes: 8 additions & 6 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
act 0.2.64
gitleaks 8.18.4
gitleaks 8.24.0
jq 1.6
nodejs 22.11.0
pre-commit 3.6.0
terraform 1.9.2
terraform-docs 0.19.0
trivy 0.61.0
vale 3.6.0
nodejs 22.15.1
# python 3.13.2

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

# TODO: Move this section - consider using a different file for the repository template dependencies.
# docker/ghcr.io/anchore/grype v0.69.1@sha256:d41fcb371d0af59f311e72123dff46900ebd6d0482391b5a830853ee4f9d1a76 # SEE: https://github.com/anchore/grype/pkgs/container/grype
# docker/ghcr.io/anchore/syft v0.92.0@sha256:63c60f0a21efb13e80aa1359ab243e49213b6cc2d7e0f8179da38e6913b997e0 # SEE: https://github.com/anchore/syft/pkgs/container/syft
# docker/ghcr.io/gitleaks/gitleaks v8.18.0@sha256:fd2b5cab12b563d2cc538b14631764a1c25577780e3b7dba71657d58da45d9d9 # SEE: https://github.com/gitleaks/gitleaks/pkgs/container/gitleaks
# docker/ghcr.io/anchore/grype v0.92.2@sha256:651e558f9ba84f2a790b3449c8a57cbbf4f34e004f7d3f14ae8f8cbeede4cd33 # SEE: https://github.com/anchore/grype/pkgs/container/grype
# docker/ghcr.io/anchore/syft v1.26.0@sha256:de078f51704a213906970b1475edd6006b8af50aa159852e125518237487b8c6 # SEE: https://github.com/anchore/syft/pkgs/container/syft
# docker/ghcr.io/gitleaks/gitleaks:v8.24.0@sha256:b8e9bf46893c2f20e10bfb4b2e783adaef519dea981b01ca6221ac325e836040 # SEE: https://github.com/gitleaks/gitleaks/pkgs/container/gitleaks
# docker/ghcr.io/igorshubovych/markdownlint-cli v0.37.0@sha256:fb3e79946fce78e1cde84d6798c6c2a55f2de11fc16606a40d49411e281d950d # SEE: https://github.com/igorshubovych/markdownlint-cli/pkgs/container/markdownlint-cli
# docker/ghcr.io/make-ops-tools/gocloc latest@sha256:6888e62e9ae693c4ebcfed9f1d86c70fd083868acb8815fe44b561b9a73b5032 # SEE: https://github.com/make-ops-tools/gocloc/pkgs/container/gocloc
# docker/ghcr.io/nhs-england-tools/github-runner-image 20230909-321fd1e-rt@sha256:ce4fd6035dc450a50d3cbafb4986d60e77cb49a71ab60a053bb1b9518139a646 # SEE: https://github.com/nhs-england-tools/github-runner-image/pkgs/container/github-runner-image
Expand All @@ -22,4 +24,4 @@ nodejs 22.15.1
# docker/jdkato/vale v3.6.0@sha256:0ef22c8d537f079633cfff69fc46f69a2196072f69cab1ab232e8a79a388e425 # SEE: https://hub.docker.com/r/jdkato/vale/tags
# docker/koalaman/shellcheck latest@sha256:e40388688bae0fcffdddb7e4dea49b900c18933b452add0930654b2dea3e7d5c # SEE: https://hub.docker.com/r/koalaman/shellcheck/tags
# docker/mstruebing/editorconfig-checker 2.7.1@sha256:dd3ca9ea50ef4518efe9be018d669ef9cf937f6bb5cfe2ef84ff2a620b5ddc24 # SEE: https://hub.docker.com/r/mstruebing/editorconfig-checker/tags
# docker/sonarsource/sonar-scanner-cli 5.0.1@sha256:494ecc3b5b1ee1625bd377b3905c4284e4f0cc155cff397805a244dee1c7d575 # SEE: https://hub.docker.com/r/sonarsource/sonar-scanner-cli/tags
# docker/sonarsource/sonar-scanner-cli 11.3@sha256:7462f132388135e32b948f8f18ff0db9ae28a87c6777f1df5b2207e04a6d7c5c # SEE: https://hub.docker.com/r/sonarsource/sonar-scanner-cli/tags
2 changes: 1 addition & 1 deletion LICENCE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MIT Licence

Copyright (c) 2024 Crown Copyright NHS England.
Copyright (c) 2025 Crown Copyright NHS England.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
1 change: 0 additions & 1 deletion infrastructure/terraform/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ components/**/backend_tfscaffold.tf

# Scaffold Plugin Cache
plugin-cache/*
bootstrap

# PyCache
**/__pycache__
Expand Down
42 changes: 22 additions & 20 deletions infrastructure/terraform/bin/terraform.sh
Original file line number Diff line number Diff line change
Expand Up @@ -539,24 +539,26 @@ fi;
[ -f "${dynamic_file_path}" ] && tf_var_file_paths+=("${dynamic_file_path}");

# Warn on duplication
duplicate_variables="$(cat "${tf_var_file_paths[@]}" | sed -n -e 's/\(^[a-zA-Z0-9_\-]\+\)\s*=.*$/\1/p' | sort | uniq -d)";
[ -n "${duplicate_variables}" ] \
&& echo -e "
###################################################################
# WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING #
###################################################################
The following input variables appear to be duplicated:

${duplicate_variables}

This could lead to unexpected behaviour. Overriding of variables
has previously been unpredictable and is not currently supported,
but it may work.

Recent changes to terraform might give you useful overriding and
map-merging functionality, please use with caution and report back
on your successes & failures.
###################################################################";
if [ ${#tf_var_file_paths[@]} -gt 0 ]; then
duplicate_variables="$(cat "${tf_var_file_paths[@]}" | sed -n -e 's/\(^[a-zA-Z0-9_\-]\+\)\s*=.*$/\1/p' | sort | uniq -d)";
[ -n "${duplicate_variables}" ] \
&& echo -e "
###################################################################
# WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING #
###################################################################
The following input variables appear to be duplicated:

${duplicate_variables}

This could lead to unexpected behaviour. Overriding of variables
has previously been unpredictable and is not currently supported,
but it may work.

Recent changes to terraform might give you useful overriding and
map-merging functionality, please use with caution and report back
on your successes & failures.
###################################################################";
fi

# Build up the tfvars arguments for terraform command line
for file_path in "${tf_var_file_paths[@]}"; do
Expand Down Expand Up @@ -791,8 +793,8 @@ case "${action}" in
;;
*)
echo -e "Generic action case invoked. Only the additional arguments will be passed to terraform, you break it you fix it:";
echo -e "\tterraform ${action} ${extra_args}";
terraform "${action}" ${extra_args} \
echo -e "\tterraform ${action} ${extra_args} | tee terraform_output";
terraform "${action}" ${extra_args} | tee terraform_output \
|| error_and_die "Terraform ${action} failed.";
;;
esac;
Expand Down
21 changes: 18 additions & 3 deletions scripts/config/.repository-template-sync-ignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
# Files and folders to ignore when syncing nhs-notify-repository-template back in to this repository
scripts/config/.repository-template-sync-ignore
.github/workflows/
nhs-notify-repository-template/

# Files and Folders in this repository to ignore
.editorconfig
.github/CODEOWNERS
.github/ISSUE_TEMPLATE
.github/workflows/cicd-*.yaml
.github/workflows/stage-*.yaml
.gitleaksignore
.vscode/
Makefile
CHANGELOG.md
project.code-workspace
README.md
scripts/config/sonar-scanner.properties
scripts/tests/
VERSION

# Files and Folders in the template repository to disregard
.devcontainer/
.github/workflows/cicd-*.yaml
.github/actions/build-docs
.github/workflows/*.disabled
*/examples/
docs/
eslint.config.mjs
infrastructure/terraform/components/
lambdas/example-lambda/
package-lock.json
package.json
scripts/**/examples/
scripts/terraform/terraform.mk
src/.vscode/
9 changes: 9 additions & 0 deletions scripts/config/.repository-template-sync-merge
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Files and folders to merge when syncing nhs-notify-repository-template back in to this repository
.github/workflows/cicd-*.yaml
.gitignore
.tool-versions
scripts/config/.repository-template-sync-ignore
scripts/config/.repository-template-sync-merge
scripts/config/vale/styles/config/vocabularies/words/accept.txt
scripts/config/vale/styles/config/vocabularies/words/reject.txt
scripts/config/vale/vale.ini
1 change: 1 addition & 0 deletions scripts/config/gitleaks.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# SEE: https://github.com/gitleaks/gitleaks/#configuration
# Do not edit this file directly as it will be overwritten by changes from the nhs-notify-repository-template on next sync

[extend]
useDefault = true # SEE: https://github.com/gitleaks/gitleaks/blob/master/config/gitleaks.toml
Expand Down
Loading
Loading