From d11279640193f58fe24221d0fd5930f097712de5 Mon Sep 17 00:00:00 2001 From: Tatyana Kostromskaya <32135588+takost@users.noreply.github.com> Date: Mon, 11 Sep 2023 13:07:54 +0000 Subject: [PATCH] Update default version to node20 --- docs/checks/nodejs.md | 4 ++-- src/Misc/layoutbin/runsvc.sh | 2 +- src/Misc/layoutbin/update.sh.template | 11 ++++++++--- src/Runner.Common/Constants.cs | 2 +- src/Runner.Common/Util/NodeUtil.cs | 2 +- src/Runner.Worker/ExecutionContext.cs | 1 - 6 files changed, 13 insertions(+), 9 deletions(-) diff --git a/docs/checks/nodejs.md b/docs/checks/nodejs.md index cbdd8659b1a..7308dcadc50 100644 --- a/docs/checks/nodejs.md +++ b/docs/checks/nodejs.md @@ -4,9 +4,9 @@ Make sure the built-in node.js has access to GitHub.com or GitHub Enterprise Server. -The runner carries its own copy of node.js executable under `/externals/node16/`. +The runner carries its own copy of node.js executable under `/externals/node20/`. -All javascript base Actions will get executed by the built-in `node` at `/externals/node16/`. +All javascript base Actions will get executed by the built-in `node` at `/externals/node20/`. > Not the `node` from `$PATH` diff --git a/src/Misc/layoutbin/runsvc.sh b/src/Misc/layoutbin/runsvc.sh index c13564567ee..4a86fa41695 100755 --- a/src/Misc/layoutbin/runsvc.sh +++ b/src/Misc/layoutbin/runsvc.sh @@ -10,7 +10,7 @@ if [ -f ".path" ]; then echo ".path=${PATH}" fi -nodever=${GITHUB_ACTIONS_RUNNER_FORCED_NODE_VERSION:-node16} +nodever=${GITHUB_ACTIONS_RUNNER_FORCED_NODE_VERSION:-node20} # insert anything to setup env when running as a service # run the host process which keep the listener alive diff --git a/src/Misc/layoutbin/update.sh.template b/src/Misc/layoutbin/update.sh.template index 4ca6b00e6b4..4d3aa359d96 100755 --- a/src/Misc/layoutbin/update.sh.template +++ b/src/Misc/layoutbin/update.sh.template @@ -135,12 +135,17 @@ if [[ "$currentplatform" == 'darwin' && restartinteractiverunner -eq 0 ]]; then then # inspect the open file handles to find the node process # we can't actually inspect the process using ps because it uses relative paths and doesn't follow symlinks - nodever="node16" + nodever="node20" path=$(lsof -a -g "$procgroup" -F n | grep $nodever/bin/node | grep externals | tail -1 | cut -c2-) - if [[ $? -ne 0 || -z "$path" ]] # Fallback if RunnerService.js was started with node12 + if [[ $? -ne 0 || -z "$path" ]] # Fallback if RunnerService.js was started with node16 then - nodever="node12" + nodever="node16" path=$(lsof -a -g "$procgroup" -F n | grep $nodever/bin/node | grep externals | tail -1 | cut -c2-) + if [[ $? -ne 0 || -z "$path" ]] # Fallback if RunnerService.js was started with node12 + then + nodever="node12" + path=$(lsof -a -g "$procgroup" -F n | grep $nodever/bin/node | grep externals | tail -1 | cut -c2-) + fi fi if [[ $? -eq 0 && -n "$path" ]] then diff --git a/src/Runner.Common/Constants.cs b/src/Runner.Common/Constants.cs index 177e3c98f3f..e4d2cfc0a7d 100644 --- a/src/Runner.Common/Constants.cs +++ b/src/Runner.Common/Constants.cs @@ -257,7 +257,7 @@ public static class Agent { public static readonly string ToolsDirectory = "agent.ToolsDirectory"; - // Set this env var to "node12" to downgrade the node version for internal functions (e.g hashfiles). This does NOT affect the version of node actions. + // Set this env var to "node16" to downgrade the node version for internal functions (e.g hashfiles). This does NOT affect the version of node actions. public static readonly string ForcedInternalNodeVersion = "ACTIONS_RUNNER_FORCED_INTERNAL_NODE_VERSION"; public static readonly string ForcedActionsNodeVersion = "ACTIONS_RUNNER_FORCE_ACTIONS_NODE_VERSION"; public static readonly string PrintLogToStdout = "ACTIONS_RUNNER_PRINT_LOG_TO_STDOUT"; diff --git a/src/Runner.Common/Util/NodeUtil.cs b/src/Runner.Common/Util/NodeUtil.cs index f2c01d7d311..5dddc13162f 100644 --- a/src/Runner.Common/Util/NodeUtil.cs +++ b/src/Runner.Common/Util/NodeUtil.cs @@ -5,7 +5,7 @@ namespace GitHub.Runner.Common.Util { public static class NodeUtil { - private const string _defaultNodeVersion = "node16"; + private const string _defaultNodeVersion = "node20"; public static readonly ReadOnlyCollection BuiltInNodeVersions = new(new[] { "node16", "node20" }); public static string GetInternalNodeVersion() { diff --git a/src/Runner.Worker/ExecutionContext.cs b/src/Runner.Worker/ExecutionContext.cs index 9ed9faeb024..46262b01a89 100644 --- a/src/Runner.Worker/ExecutionContext.cs +++ b/src/Runner.Worker/ExecutionContext.cs @@ -836,7 +836,6 @@ public void InitializeJob(Pipelines.AgentJobRequestMessage message, Cancellation // Actions environment ActionsEnvironment = message.ActionsEnvironment; - // Service container info Global.ServiceContainers = new List();