Skip to content

Commit 47f7789

Browse files
committed
Merge remote-tracking branch 'origin/main' into add_script_to_check_github_actions_use_sha
2 parents 0a35b28 + bef1c5f commit 47f7789

21 files changed

Lines changed: 76 additions & 12 deletions

File tree

.devcontainer/devcontainer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@
2222
"--network=host"
2323
],
2424
"remoteEnv": { "LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}" },
25-
"postAttachCommand": "git-secrets --register-aws; git-secrets --add-provider -- cat /usr/share/secrets-scanner/nhsd-rules-deny.txt",
25+
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
26+
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
27+
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
2628
"features": {
2729
},
2830
"customizations": {

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ on:
55

66
jobs:
77
get_config_values:
8-
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@5ac2707dd9cd60ad127275179495b9c890d74711
8+
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@f2d4d6942115472d3f08316cd25f400b02a9dc69
99
with:
1010
verify_published_from_main_image: true
1111
quality_checks:
12-
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@5ac2707dd9cd60ad127275179495b9c890d74711
12+
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@f2d4d6942115472d3f08316cd25f400b02a9dc69
1313
needs:
1414
- get_config_values
1515
with:
@@ -18,7 +18,7 @@ jobs:
1818
SONAR_TOKEN: '${{ secrets.SONAR_TOKEN }}'
1919
tag_release:
2020
needs: [quality_checks, get_config_values]
21-
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release-devcontainer.yml@5ac2707dd9cd60ad127275179495b9c890d74711
21+
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release-devcontainer.yml@f2d4d6942115472d3f08316cd25f400b02a9dc69
2222
permissions:
2323
id-token: write
2424
contents: write

.github/workflows/pull_request.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,16 @@ jobs:
99
dependabot-auto-approve-and-merge:
1010
needs: quality_checks
1111
uses: >-
12-
NHSDigital/eps-common-workflows/.github/workflows/dependabot-auto-approve-and-merge.yml@5ac2707dd9cd60ad127275179495b9c890d74711
12+
NHSDigital/eps-common-workflows/.github/workflows/dependabot-auto-approve-and-merge.yml@f2d4d6942115472d3f08316cd25f400b02a9dc69
1313
secrets:
1414
AUTOMERGE_APP_ID: '${{ secrets.AUTOMERGE_APP_ID }}'
1515
AUTOMERGE_PEM: '${{ secrets.AUTOMERGE_PEM }}'
1616
get_config_values:
17-
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@5ac2707dd9cd60ad127275179495b9c890d74711
17+
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@f2d4d6942115472d3f08316cd25f400b02a9dc69
1818
with:
1919
verify_published_from_main_image: false
2020
quality_checks:
21-
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@5ac2707dd9cd60ad127275179495b9c890d74711
21+
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@f2d4d6942115472d3f08316cd25f400b02a9dc69
2222
needs:
2323
- get_config_values
2424
with:
@@ -27,7 +27,7 @@ jobs:
2727
SONAR_TOKEN: '${{ secrets.SONAR_TOKEN }}'
2828
pr_title_format_check:
2929
uses: >-
30-
NHSDigital/eps-common-workflows/.github/workflows/pr_title_check.yml@5ac2707dd9cd60ad127275179495b9c890d74711
30+
NHSDigital/eps-common-workflows/.github/workflows/pr_title_check.yml@f2d4d6942115472d3f08316cd25f400b02a9dc69
3131
get_issue_number:
3232
runs-on: ubuntu-22.04
3333
needs: quality_checks

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ on:
66

77
jobs:
88
get_config_values:
9-
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@5ac2707dd9cd60ad127275179495b9c890d74711
9+
uses: NHSDigital/eps-common-workflows/.github/workflows/get-repo-config.yml@f2d4d6942115472d3f08316cd25f400b02a9dc69
1010
with:
1111
verify_published_from_main_image: false
1212
quality_checks:
13-
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@5ac2707dd9cd60ad127275179495b9c890d74711
13+
uses: NHSDigital/eps-common-workflows/.github/workflows/quality-checks-devcontainer.yml@f2d4d6942115472d3f08316cd25f400b02a9dc69
1414
needs:
1515
- get_config_values
1616
with:
@@ -19,7 +19,7 @@ jobs:
1919
SONAR_TOKEN: '${{ secrets.SONAR_TOKEN }}'
2020
tag_release:
2121
needs: [quality_checks, get_config_values]
22-
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release-devcontainer.yml@5ac2707dd9cd60ad127275179495b9c890d74711
22+
uses: NHSDigital/eps-common-workflows/.github/workflows/tag-release-devcontainer.yml@f2d4d6942115472d3f08316cd25f400b02a9dc69
2323
permissions:
2424
id-token: write
2525
contents: write

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@ build-all: build-base-image build-node-24-image build-node-24-python-3-10-image
6565
build-regression-tests-image
6666

6767
build-image: guard-CONTAINER_NAME guard-BASE_VERSION_TAG guard-BASE_FOLDER guard-IMAGE_TAG
68+
workspace_folder="$${CONTAINER_NAME}"; \
69+
case "$${CONTAINER_NAME}" in \
70+
eps_*) workspace_folder="$$(printf '%s' "$${CONTAINER_NAME}" | tr '_' '-')" ;; \
71+
esac; \
6872
npx devcontainer build \
69-
--workspace-folder ./src/$${BASE_FOLDER}/$${CONTAINER_NAME} \
73+
--workspace-folder ./src/$${BASE_FOLDER}/$${workspace_folder} \
7074
$(NO_CACHE_FLAG) \
7175
--push false \
7276
--output type=image,name="${CONTAINER_PREFIX}$${CONTAINER_NAME}:$${IMAGE_TAG}",push=false,compression=zstd \

src/base/.devcontainer/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ ENV CONTAINER_NAME=${CONTAINER_NAME}
1010
ENV TARGETARCH=${TARGETARCH}
1111

1212
COPY .tool-versions.asdf ${SCRIPTS_DIR}/${CONTAINER_NAME}/.tool-versions.asdf
13+
COPY --chmod=755 scripts/lifecycle/*.sh ${SCRIPTS_DIR}/
1314
COPY --chmod=755 scripts/root_install.sh ${SCRIPTS_DIR}/${CONTAINER_NAME}/root_install.sh
1415
COPY --chmod=755 Mk ${SCRIPTS_DIR}/Mk
1516

src/base/.devcontainer/devcontainer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
"IMAGE_TAG": "${localEnv:IMAGE_TAG}"
1313
}
1414
},
15+
"postCreateCommand": "bash ${SCRIPTS_DIR}/post_create.sh",
16+
"postStartCommand": "bash ${SCRIPTS_DIR}/post_start.sh",
17+
"postAttachCommand": "bash ${SCRIPTS_DIR}/post_attach.sh",
1518
"features": {
1619
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
1720
"version": "latest",
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
# Script to run as devcontainer postAttachCommand
3+
set -euo pipefail
4+
5+
# currently empty
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
# Script to run as devcontainer postCreateCommand
3+
set -euo pipefail
4+
5+
# Install git-secrets, register AWS patterns and NHS rules in an idempotent way
6+
if ! git config --get-all secrets.patterns | grep -Fq AKIA; then
7+
git-secrets --register-aws
8+
fi
9+
if ! git config --get-all secrets.providers | grep -Fxq "cat /usr/share/secrets-scanner/nhsd-rules-deny.txt"; then
10+
git-secrets --add-provider -- cat /usr/share/secrets-scanner/nhsd-rules-deny.txt
11+
fi
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
# Script to run as devcontainer postStartCommand
3+
set -euo pipefail
4+
5+
# currently empty

0 commit comments

Comments
 (0)