From 9f72ff02ed75d4df603bd092ccaf6ed116b602c6 Mon Sep 17 00:00:00 2001 From: Andrew Lee <1517745+andrewrlee@users.noreply.github.com> Date: Thu, 5 Dec 2024 15:13:52 +0000 Subject: [PATCH] Set node version in github actions --- .github/workflows/pipeline.yml | 27 ++++++++++++------- .github/workflows/security_npm_dependency.yml | 4 +++ .github/workflows/security_trivy.yml | 2 +- 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 6a023600..6cb28b79 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -3,7 +3,7 @@ name: Pipeline [test -> build -> deploy] on: push: branches: - - '**' + - '**' workflow_dispatch: inputs: additional_docker_tag: @@ -17,15 +17,20 @@ on: default: false type: boolean +env: + node_version: 22.12 + permissions: contents: read packages: write - + jobs: # main node build workflow node_build: name: node build uses: ministryofjustice/hmpps-github-actions/.github/workflows/node_build.yml@v1 # WORKFLOW_VERSION + with: + node_version: NODE_VERSION secrets: inherit # generic node unit tests - feel free to override with local tests if required node_unit_tests: @@ -33,16 +38,20 @@ jobs: uses: ministryofjustice/hmpps-github-actions/.github/workflows/node_unit_tests.yml@v1 # WORKFLOW_VERSION needs: [node_build] secrets: inherit + with: + node_version: NODE_VERSION # generic node integration tests using wiremock - feel free to override with local tests if required node_integration_tests: name: node integration tests uses: ministryofjustice/hmpps-github-actions/.github/workflows/node_integration_tests.yml@v1 # WORKFLOW_VERSION needs: [node_build] secrets: inherit + with: + node_version: NODE_VERSION helm_lint: strategy: matrix: - environments: ['dev','preprod','prod'] + environments: ['dev', 'preprod', 'prod'] name: helm lint uses: ministryofjustice/hmpps-github-actions/.github/workflows/test_helm_lint.yml@v1 # WORKFLOW_VERSION secrets: inherit @@ -52,7 +61,7 @@ jobs: name: Build docker image from hmpps-github-actions if: github.ref == 'refs/heads/main' uses: ministryofjustice/hmpps-github-actions/.github/workflows/docker_build.yml@v1 # WORKFLOW_VERSION - needs: + needs: - node_integration_tests - node_unit_tests with: @@ -62,8 +71,8 @@ jobs: push: ${{ inputs.push || true }} docker_multiplatform: true deploy_dev: - name: Deploy to the development environment - needs: + name: Deploy to the development environment + needs: - build - helm_lint uses: ministryofjustice/hmpps-github-actions/.github/workflows/deploy_env.yml@v1 # WORKFLOW_VERSION @@ -73,7 +82,7 @@ jobs: app_version: '${{ needs.build.outputs.app_version }}' # deploy_preprod: # name: Deploy to pre-production environment - # needs: + # needs: # - build # - deploy_dev # uses: ministryofjustice/hmpps-github-actions/.github/workflows/deploy_env.yml@v1 # WORKFLOW_VERSION @@ -83,11 +92,11 @@ jobs: # app_version: '${{ needs.build.outputs.app_version }}' # deploy_prod: # name: Deploy to production environment - # needs: + # needs: # - build # - deploy_preprod # uses: ministryofjustice/hmpps-github-actions/.github/workflows/deploy_env.yml@v1 # WORKFLOW_VERSION # secrets: inherit # with: # environment: 'prod' - # app_version: '${{ needs.build.outputs.app_version }}' \ No newline at end of file + # app_version: '${{ needs.build.outputs.app_version }}' diff --git a/.github/workflows/security_npm_dependency.yml b/.github/workflows/security_npm_dependency.yml index 2df8859c..baa57014 100644 --- a/.github/workflows/security_npm_dependency.yml +++ b/.github/workflows/security_npm_dependency.yml @@ -1,3 +1,6 @@ +env: + NODE_VERSION: 22.12 + name: Security npm dependency check on: workflow_dispatch: @@ -9,4 +12,5 @@ jobs: uses: ministryofjustice/hmpps-github-actions/.github/workflows/security_npm_dependency.yml@v1.0 # WORKFLOW_VERSION with: channel_id: C05J915DX0Q + node_version: NODE_VERSION secrets: inherit diff --git a/.github/workflows/security_trivy.yml b/.github/workflows/security_trivy.yml index 164cb24f..d29134c8 100644 --- a/.github/workflows/security_trivy.yml +++ b/.github/workflows/security_trivy.yml @@ -4,7 +4,7 @@ on: schedule: - cron: "19 6 * * MON-FRI" # Every weekday jobs: - security-kotlin-trivy-check: + security-typescript-trivy-check: name: Project security trivy dependency check uses: ministryofjustice/hmpps-github-actions/.github/workflows/security_trivy.yml@v1.0 # WORKFLOW_VERSION with: