@@ -220,8 +220,15 @@ jobs:
220220 outputs :
221221 docker_images : ${{ steps.normalized_docker_images.outputs.images }}
222222 steps :
223- - *init_tool_versions
224- - *checkout
223+ - name : copy .tool-versions
224+ run : |
225+ cp /home/vscode/.tool-versions "$HOME/.tool-versions"
226+
227+ - name : Checkout code
228+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
229+ with :
230+ ref : ${{ env.BRANCH_NAME }}
231+ fetch-depth : 0
225232 - name : Determine docker images to scan
226233 id : normalized_docker_images
227234 env :
@@ -292,10 +299,28 @@ jobs:
292299 matrix :
293300 docker_image : ${{ fromJson(needs.get_docker_images_to_scan.outputs.docker_images) }}
294301 steps :
295- - *init_tool_versions
296- - *checkout
297- - *setup_npmrc
298- - *cache_npm
302+ - name : copy .tool-versions
303+ run : |
304+ cp /home/vscode/.tool-versions "$HOME/.tool-versions"
305+
306+ - name : Checkout code
307+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
308+ with :
309+ ref : ${{ env.BRANCH_NAME }}
310+ fetch-depth : 0
311+
312+ - name : Setting up .npmrc
313+ env :
314+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
315+ run : |
316+ echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc
317+ echo "@nhsdigital:registry=https://npm.pkg.github.com" >> ~/.npmrc
318+
319+ - name : Cache npm dependencies
320+ uses : actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7
321+ with :
322+ path : ./node_modules
323+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
299324
300325 - name : make install
301326 run : |
@@ -331,10 +356,28 @@ jobs:
331356 run :
332357 shell : bash
333358 steps :
334- - *init_tool_versions
335- - *checkout
336- - *setup_npmrc
337- - *cache_npm
359+ - name : copy .tool-versions
360+ run : |
361+ cp /home/vscode/.tool-versions "$HOME/.tool-versions"
362+
363+ - name : Checkout code
364+ uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
365+ with :
366+ ref : ${{ env.BRANCH_NAME }}
367+ fetch-depth : 0
368+
369+ - name : Setting up .npmrc
370+ env :
371+ NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
372+ run : |
373+ echo "//npm.pkg.github.com/:_authToken=${NODE_AUTH_TOKEN}" >> ~/.npmrc
374+ echo "@nhsdigital:registry=https://npm.pkg.github.com" >> ~/.npmrc
375+
376+ - name : Cache npm dependencies
377+ uses : actions/cache@668228422ae6a00e4ad889ee87cd7109ec5666a7
378+ with :
379+ path : ./node_modules
380+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
338381
339382 - name : Check for SAM templates
340383 id : check_sam_templates
0 commit comments