3333 description : comma separated list of docker image references to scan when docker scanning is enabled.
3434 default : " "
3535 required : false
36+ runtime_docker_image :
37+ type : string
38+ required : true
3639
3740jobs :
3841 quality_checks :
3942 runs-on : ubuntu-22.04
43+ container :
44+ image : ${{ inputs.runtime_docker_image }}
4045 steps :
4146 - uses : actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654
4247 if : ${{ inputs.install_java }}
@@ -50,70 +55,10 @@ jobs:
5055 with :
5156 ref : ${{ env.BRANCH_NAME }}
5257 fetch-depth : 0
53-
54- # Must be done before anything installs, or it will check dependencies for secrets too.
55- - name : Ensure .gitallowed exists, for secret scanning
56- run : |
57- if [ ! -f ".gitallowed" ]; then
58- echo "Creating empty .gitallowed file"
59- touch .gitallowed
60- fi
61- echo "./nhsd-rules-deny.txt:10" >> .gitallowed
62- echo "Allowing the following regex patterns:"
63- cat .gitallowed
64-
65- - name : Install git-secrets
66- run : |
67- sudo apt-get update
68- sudo apt-get install -y git curl
69- git clone https://github.com/awslabs/git-secrets.git /tmp/git-secrets
70- cd /tmp/git-secrets
71- sudo make install
72-
73- - name : Download regex patterns
74- run : |
75- curl -L https://raw.githubusercontent.com/NHSDigital/software-engineering-quality-framework/main/tools/nhsd-git-secrets/nhsd-rules-deny.txt -o nhsd-rules-deny.txt
76-
77- - name : Configure git-secrets
78- run : |
79- git-secrets --register-aws
80- git-secrets --add-provider -- cat nhsd-rules-deny.txt
81-
8258 - name : Run secrets scan
8359 run : |
8460 git-secrets --scan-history .
8561
86- # using git commit sha for version of action to ensure we have stable version
87- - &install_asdf
88- name : Install asdf
89- uses : asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47
90- with :
91- asdf_version : ${{ inputs.asdfVersion }}
92-
93- - &cache_asdf
94- name : Cache asdf
95- uses : actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb
96- with :
97- path : ~/.asdf
98- key : ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}-${{ inputs.asdfVersion }}
99-
100- - &install_asdf_deps
101- name : Install asdf dependencies in .tool-versions
102- uses : asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47
103- with :
104- asdf_version : ${{ inputs.asdfVersion }}
105- env :
106- PYTHON_CONFIGURE_OPTS : --enable-shared
107-
108- - &reinstall_poetry
109- name : Reinstall poetry
110- if : ${{ inputs.reinstall_poetry }}
111- run : |
112- poetry_tool_version=$(cat .tool-versions | grep poetry)
113- poetry_version=${poetry_tool_version//"poetry "}
114- asdf uninstall poetry "$poetry_version"
115- asdf install poetry
116-
11762 - &setup_npmrc
11863 name : Setting up .npmrc
11964 env :
@@ -356,6 +301,8 @@ jobs:
356301 outputs :
357302 docker_images : ${{ steps.normalized_docker_images.outputs.images }}
358303 runs-on : ubuntu-22.04
304+ container :
305+ image : ${{ inputs.runtime_docker_image }}
359306 steps :
360307 - name : Checkout code
361308 uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
@@ -420,6 +367,8 @@ jobs:
420367
421368 docker_vulnerability_scan :
422369 runs-on : ubuntu-22.04
370+ container :
371+ image : ghcr.io/nhsdigital/eps-devcontainers/fhir_facade_api:v1.0.0
423372 needs : get_docker_images_to_scan
424373 if : ${{ inputs.run_docker_scan == true }}
425374 strategy :
@@ -431,36 +380,6 @@ jobs:
431380 with :
432381 ref : ${{ env.BRANCH_NAME }}
433382 fetch-depth : 0
434- # using git commit sha for version of action to ensure we have stable version
435- - name : Install asdf
436- uses : asdf-vm/actions/setup@b7bcd026f18772e44fe1026d729e1611cc435d47
437- with :
438- asdf_version : ${{ inputs.asdfVersion }}
439-
440- - name : Cache asdf
441- uses : actions/cache@9255dc7a253b0ccc959486e2bca901246202afeb
442- with :
443- path : |
444- ~/.asdf
445- key : ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}-${{ inputs.asdfVersion }}
446- restore-keys : |
447- ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}-${{ inputs.asdfVersion }}
448-
449- - name : Install asdf dependencies in .tool-versions
450- uses : asdf-vm/actions/install@b7bcd026f18772e44fe1026d729e1611cc435d47
451- with :
452- asdf_version : ${{ inputs.asdfVersion }}
453- env :
454- PYTHON_CONFIGURE_OPTS : --enable-shared
455-
456- - name : Reinstall poetry
457- if : ${{ inputs.reinstall_poetry }}
458- run : |
459- poetry_tool_version=$(cat .tool-versions | grep poetry)
460- poetry_version=${poetry_tool_version//"poetry "}
461- asdf uninstall poetry "$poetry_version"
462- asdf install poetry
463-
464383 - name : Setting up .npmrc
465384 env :
466385 NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
@@ -508,12 +427,10 @@ jobs:
508427
509428 IaC-validation :
510429 runs-on : ubuntu-22.04
430+ container :
431+ image : ${{ inputs.runtime_docker_image }}
511432 steps :
512433 - *checkout
513- - *install_asdf
514- - *cache_asdf
515- - *install_asdf_deps
516- - *reinstall_poetry
517434
518435 - name : Check for SAM templates
519436 id : check_sam_templates
0 commit comments