From f953ab8d9c8766cec7047bab8940db9c643d3842 Mon Sep 17 00:00:00 2001 From: Lars Gyrup Brink Nielsen Date: Tue, 23 Jul 2024 12:09:22 +0200 Subject: [PATCH] chore(core): update `actions/setup-node` to `v4` in `ci-workflow` generator (#26642) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, the following warning is output when using GitHub Actions. > Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/setup-node@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/. ## Current Behavior - The `actions/setup-node` GitHub Action is installed in version 3.x which uses the deprecated Node.js 16 runtime for GitHub Actions ## Expected Behavior - The `actions/setup-node` GitHub Action is installed in version 4.x which uses the supported Node.js 20 runtime for GitHub Actions ## Related Issue(s) Fixes # --------- Co-authored-by: Miroslav Jonaš --- .../__snapshots__/ci-workflow.spec.ts.snap | 32 +++++++++---------- .../__workflowFileName__.yml__tmpl__ | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap b/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap index 92f5d7461f6b0..b593b3e21ede9 100644 --- a/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap +++ b/packages/workspace/src/generators/ci-workflow/__snapshots__/ci-workflow.spec.ts.snap @@ -171,7 +171,7 @@ jobs: - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'npm' @@ -214,7 +214,7 @@ jobs: - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'npm' @@ -660,7 +660,7 @@ jobs: - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'npm' @@ -702,7 +702,7 @@ jobs: - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'npm' @@ -928,7 +928,7 @@ jobs: - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'pnpm' @@ -974,7 +974,7 @@ jobs: - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'pnpm' @@ -1187,7 +1187,7 @@ jobs: - run: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'yarn' @@ -1229,7 +1229,7 @@ jobs: - run: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'yarn' @@ -1448,7 +1448,7 @@ jobs: # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'npm' @@ -1492,7 +1492,7 @@ jobs: # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="e2e-ci" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'npm' @@ -1950,7 +1950,7 @@ jobs: # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'npm' @@ -1993,7 +1993,7 @@ jobs: # - run: npx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'npm' @@ -2225,7 +2225,7 @@ jobs: # - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'pnpm' @@ -2272,7 +2272,7 @@ jobs: # - run: pnpm dlx nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'pnpm' @@ -2491,7 +2491,7 @@ jobs: # - run: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'yarn' @@ -2534,7 +2534,7 @@ jobs: # - run: yarn nx-cloud start-ci-run --distribute-on="3 linux-medium-js" --stop-agents-after="build" # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: 'yarn' diff --git a/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ b/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ index 167ae3964065a..14a73ba60d3a3 100644 --- a/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ +++ b/packages/workspace/src/generators/ci-workflow/files/github/.github/workflows/__workflowFileName__.yml__tmpl__ @@ -37,7 +37,7 @@ jobs: <% } %> <% if(packageManager != 'bun'){ %> # Cache node_modules - - uses: actions/setup-node@v3 + - uses: actions/setup-node@v4 with: node-version: 20 cache: '<%= packageManager %>'