Skip to content

Commit e04314d

Browse files
RossBugginsNHSnhsd-angel-pastor
authored andcommitted
updates.
1 parent 05e5233 commit e04314d

File tree

74 files changed

+16276
-3127
lines changed

Some content is hidden

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

74 files changed

+16276
-3127
lines changed

.coverage

-52 KB
Binary file not shown.

.devcontainer/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
"containerEnv": {
33
"GITHUBMONITOR": "false",
44
"MAKECONFIG": "true",
5-
"SHOWWELCOME": "true",
5+
"SHOWWELCOME": "false",
66
"UPDATEFROMTEMPLATE": "false"
77
},
8-
"image": "ghcr.io/nhsdigital/nhs-notify-devcontainer-loaded-codespaces:main",
9-
"name": "Codespaces Online Development"
8+
"image": "ghcr.io/nhsdigital/nhs-notify-devcontainer-loaded-codespaces:1.0.19",
9+
"name": "Codespaces"
1010
}

.devcontainer/nhs-notify-devcontainer-loaded/devcontainer.json renamed to .devcontainer/local-dev/devcontainer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
"containerEnv": {
33
"GITHUBMONITOR": "false",
44
"MAKECONFIG": "true",
5-
"SHOWWELCOME": "true",
5+
"SHOWWELCOME": "false",
66
"UPDATEFROMTEMPLATE": "false"
77
},
8-
"image": "ghcr.io/nhsdigital/nhs-notify-devcontainer-loaded:1.0.17",
9-
"name": "Notify Loaded 1.0.17",
8+
"image": "ghcr.io/nhsdigital/nhs-notify-devcontainer-loaded:1.0.19",
9+
"name": "Local Development",
1010
"postStartCommand": "mkdir -p ~/.gnupg && echo '## 1-day timeout' > ~/.gnupg/gpg-agent.conf && echo 'default-cache-ttl 86400' >> ~/.gnupg/gpg-agent.conf && echo 'max-cache-ttl 86400' >> ~/.gnupg/gpg-agent.conf && gpg-connect-agent reloadagent /bye 2>/dev/null || true"
1111
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
3+
"name": "Ubuntu 24"
4+
}

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

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,39 @@ runs:
99
steps:
1010
- name: Checkout
1111
uses: actions/checkout@v5
12-
- uses: actions/setup-node@v6
13-
with:
14-
node-version: 24
15-
- name: Npm cli install
16-
working-directory: ./docs
17-
run: npm ci
18-
shell: bash
19-
- name: Setup Ruby
20-
uses: ruby/[email protected]
21-
with:
22-
ruby-version: "3.4.7" # Not needed with a .ruby-version file
23-
bundler-cache: false # runs 'bundle install' and caches installed gems automatically
24-
#cache-version: 0 # Increment this number if you need to re-download cached gems
25-
working-directory: "./docs"
12+
13+
- name: "Setup dependencies and asdf with cache"
14+
uses: ./.github/actions/setup-dependencies-asdf-with-cache
15+
16+
# - uses: actions/setup-node@v6
17+
# with:
18+
# node-version: 24
19+
# - name: Npm cli install
20+
# working-directory: ./docs
21+
# run: npm ci
22+
# shell: bash
23+
# - name: Setup Ruby
24+
# uses: ruby/[email protected]
25+
# with:
26+
# ruby-version: "3.4.7" # Not needed with a .ruby-version file
27+
# bundler-cache: false # runs 'bundle install' and caches installed gems automatically
28+
# #cache-version: 0 # Increment this number if you need to re-download cached gems
29+
# working-directory: "./docs"
30+
2631
- name: Setup Pages
2732
id: pages
2833
uses: actions/configure-pages@v5
2934
- name: Build with Jekyll
3035
working-directory: ./docs
3136
# Outputs to the './_site' directory by default
3237
shell: bash
33-
run: make build-ci BASE_URL=${{ steps.pages.outputs.base_path }} VERSION=${{ inputs.version }}
38+
#run: make build-ci BASE_URL=${{ steps.pages.outputs.base_path }} VERSION=${{ inputs.version }}
39+
run: make build BASE_URL="${BASE_URL}" VERSION="${VERSION}"
3440
#run: bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
3541
env:
3642
JEKYLL_ENV: production
43+
BASE_URL: ${{ steps.pages.outputs.base_path }}
44+
VERSION: ${{ inputs.version }}
3745
- name: Upload artifact
3846
# Automatically uploads an artifact from the './_site' directory by default
3947
uses: actions/upload-pages-artifact@v3

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

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

.github/actions/create-lines-of-code-report/action.yaml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ runs:
2424
steps:
2525
- name: "Create CLOC report"
2626
shell: bash
27+
env:
28+
BUILD_DATETIME: ${{ inputs.build_datetime }}
2729
run: |
28-
export BUILD_DATETIME=${{ inputs.build_datetime }}
2930
./scripts/reports/create-lines-of-code-report.sh
3031
- name: "Compress CLOC report"
3132
shell: bash
@@ -51,7 +52,10 @@ runs:
5152
- name: "Send the CLOC report to the central location"
5253
shell: bash
5354
if: steps.check.outputs.secrets_exist == 'true'
55+
env:
56+
BUCKET_ENDPOINT: ${{ inputs.idp_aws_report_upload_bucket_endpoint }}
57+
BUILD_TIMESTAMP: ${{ inputs.build_timestamp }}
5458
run: |
5559
aws s3 cp \
5660
./lines-of-code-report.json.zip \
57-
${{ inputs.idp_aws_report_upload_bucket_endpoint }}/${{ inputs.build_timestamp }}-lines-of-code-report.json.zip
61+
"$BUCKET_ENDPOINT/$BUILD_TIMESTAMP-lines-of-code-report.json.zip"

.github/actions/perform-static-analysis/action.yaml

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,55 @@ inputs:
1010
sonar_token:
1111
description: "Sonar token, the API key"
1212
required: false
13+
# Note, conmpsite actions only support string inputs
14+
ignore_sonar_failure:
15+
description: "Whether to fail the build if the quality gate fails"
16+
default: 'false'
17+
18+
outputs:
19+
sonar_report_url:
20+
description: "URL to the SonarCloud report for this branch"
21+
value: ${{ steps.report.outputs.url }}
22+
1323
runs:
1424
using: "composite"
1525
steps:
26+
- name: "Warn that ignore failure is enabled"
27+
if: ${{ fromJSON(inputs.ignore_sonar_failure) }}
28+
shell: bash
29+
run: |
30+
echo "WARNING: SonarQube failures will be ignored as per configuration."
31+
echo "::warning title=Ignore Sonar failures is enabled:: SonarQube failures will be ignored as per configuration."
1632
- name: "Check prerequisites for performing static analysis"
1733
shell: bash
1834
id: check
1935
run: echo "secret_exist=${{ inputs.sonar_token != '' }}" >> $GITHUB_OUTPUT
2036
- name: "Perform static analysis"
2137
shell: bash
38+
id: sonar
2239
if: steps.check.outputs.secret_exist == 'true'
40+
continue-on-error: ${{ fromJSON(inputs.ignore_sonar_failure) }}
41+
env:
42+
SONAR_ORGANISATION_KEY: ${{ inputs.sonar_organisation_key }}
43+
SONAR_PROJECT_KEY: ${{ inputs.sonar_project_key }}
44+
SONAR_TOKEN: ${{ inputs.sonar_token }}
2345
run: |
2446
export BRANCH_NAME=${GITHUB_HEAD_REF:-$(echo $GITHUB_REF | sed 's#refs/heads/##')}
25-
export SONAR_ORGANISATION_KEY=${{ inputs.sonar_organisation_key }}
26-
export SONAR_PROJECT_KEY=${{ inputs.sonar_project_key }}
27-
export SONAR_TOKEN=${{ inputs.sonar_token }}
2847
./scripts/reports/perform-static-analysis.sh
48+
- name: "Add SonarCloud report link to step summary"
49+
shell: bash
50+
id: report
51+
if: steps.sonar.outcome == 'success' || (steps.sonar.outcome == 'failure' && fromJSON(inputs.ignore_sonar_failure))
52+
env:
53+
SONAR_ORGANISATION_KEY: ${{ inputs.sonar_organisation_key }}
54+
SONAR_PROJECT_KEY: ${{ inputs.sonar_project_key }}
55+
run: |
56+
export BRANCH_NAME=${GITHUB_HEAD_REF:-$(echo $GITHUB_REF | sed 's#refs/heads/##')}
57+
ENCODED_BRANCH=$(echo "$BRANCH_NAME" | sed 's/\//%2F/g')
58+
SONAR_URL="https://sonarcloud.io/summary/overall?id=${SONAR_PROJECT_KEY}&branch=${ENCODED_BRANCH}"
59+
echo "url=${SONAR_URL}" >> $GITHUB_OUTPUT
60+
echo "### :bar_chart: SonarCloud Analysis Report" >> $GITHUB_STEP_SUMMARY
61+
echo "" >> $GITHUB_STEP_SUMMARY
62+
echo "**Branch:** \`${BRANCH_NAME}\`" >> $GITHUB_STEP_SUMMARY
63+
echo "" >> $GITHUB_STEP_SUMMARY
64+
echo "[View detailed SonarCloud report →]($SONAR_URL)" >> $GITHUB_STEP_SUMMARY
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: "Build Docs"
2+
description: "build jekyll docs"
3+
inputs:
4+
version:
5+
description: "Version of the software, set by the CI/CD pipeline workflow"
6+
required: true
7+
type: string
8+
is_version_prerelease:
9+
description: "Is this a semantically versioned pre release, set by the CI/CD pipeline workflow"
10+
required: true
11+
type: string
12+
13+
runs:
14+
using: "composite"
15+
steps:
16+
- name: "Checkout code"
17+
uses: actions/checkout@v5
18+
19+
- name: "Get artifacts: jekyll docs"
20+
uses: actions/download-artifact@v5
21+
with:
22+
path: ./artifacts/jekyll-docs-${{ inputs.version }}
23+
name: jekyll-docs-${{ inputs.version }}
24+
25+
- name: "Get artifacts: schema"
26+
uses: actions/download-artifact@v5
27+
with:
28+
path: ./artifacts/schemas-${{ inputs.version }}
29+
name: schemas-${{ inputs.version }}
30+
31+
- name: Draft Release
32+
shell: bash
33+
env:
34+
GH_TOKEN: ${{ github.token }}
35+
GH_REPO: ${{ github.repository }}
36+
VERSION: ${{ inputs.version }}
37+
IS_PRERELEASE: ${{ inputs.is_version_prerelease }}
38+
run: |
39+
PRERELEASE_FLAG=""
40+
if [ "$IS_PRERELEASE" = "true" ]; then
41+
PRERELEASE_FLAG="--prerelease"
42+
fi
43+
gh release create \
44+
"$VERSION" \
45+
--draft \
46+
--latest \
47+
--title "$VERSION" \
48+
--notes "Release of $VERSION" \
49+
$PRERELEASE_FLAG
50+
51+
- name: "Upload jeykll docs release asset"
52+
shell: bash
53+
env:
54+
GH_TOKEN: ${{ github.token }}
55+
GH_REPO: ${{ github.repository }}
56+
VERSION: ${{ inputs.version }}
57+
run: |
58+
cp "./artifacts/jekyll-docs-$VERSION/artifact.tar" "$RUNNER_TEMP/jekyll-docs-$VERSION.tar"
59+
gh release upload \
60+
"$VERSION" \
61+
"$RUNNER_TEMP/jekyll-docs-$VERSION.tar#jekyll-docs-$VERSION"
62+
63+
- name: "Upload schema release asset"
64+
shell: bash
65+
env:
66+
GH_TOKEN: ${{ github.token }}
67+
GH_REPO: ${{ github.repository }}
68+
VERSION: ${{ inputs.version }}
69+
run: |
70+
cp "./artifacts/schemas-$VERSION/artifact.tar" "$RUNNER_TEMP/schemas-$VERSION.tar"
71+
gh release upload \
72+
"$VERSION" \
73+
"$RUNNER_TEMP/schemas-$VERSION.tar#schemas-$VERSION"
74+
75+
76+
- name: Publish Release
77+
shell: bash
78+
env:
79+
GH_TOKEN: ${{ github.token }}
80+
GH_REPO: ${{ github.repository }}
81+
VERSION: ${{ inputs.version }}
82+
run: gh release edit "$VERSION" --draft=false

.github/actions/scan-dependencies/action.yaml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ runs:
2424
steps:
2525
- name: "Generate SBOM"
2626
shell: bash
27+
env:
28+
BUILD_DATETIME: ${{ inputs.build_datetime }}
2729
run: |
28-
export BUILD_DATETIME=${{ inputs.build_datetime }}
2930
./scripts/reports/create-sbom-report.sh
3031
- name: "Compress SBOM report"
3132
shell: bash
@@ -39,8 +40,9 @@ runs:
3940
retention-days: 21
4041
- name: "Scan vulnerabilities"
4142
shell: bash
43+
env:
44+
BUILD_DATETIME: ${{ inputs.build_datetime }}
4245
run: |
43-
export BUILD_DATETIME=${{ inputs.build_datetime }}
4446
./scripts/reports/scan-vulnerabilities.sh
4547
- name: "Compress vulnerabilities report"
4648
shell: bash
@@ -65,10 +67,13 @@ runs:
6567
- name: "Send the SBOM and vulnerabilities reports to the central location"
6668
shell: bash
6769
if: steps.check.outputs.secrets_exist == 'true'
70+
env:
71+
BUCKET_ENDPOINT: ${{ inputs.idp_aws_report_upload_bucket_endpoint }}
72+
BUILD_TIMESTAMP: ${{ inputs.build_timestamp }}
6873
run: |
6974
aws s3 cp \
7075
./sbom-repository-report.json.zip \
71-
${{ inputs.idp_aws_report_upload_bucket_endpoint }}/${{ inputs.build_timestamp }}-sbom-repository-report.json.zip
76+
"$BUCKET_ENDPOINT/$BUILD_TIMESTAMP-sbom-repository-report.json.zip"
7277
aws s3 cp \
7378
./vulnerabilities-repository-report.json.zip \
74-
${{ inputs.idp_aws_report_upload_bucket_endpoint }}/${{ inputs.build_timestamp }}-vulnerabilities-repository-report.json.zip
79+
"$BUCKET_ENDPOINT/$BUILD_TIMESTAMP-vulnerabilities-repository-report.json.zip"

0 commit comments

Comments
 (0)