Skip to content

Commit

Permalink
Update default version to node20
Browse files Browse the repository at this point in the history
  • Loading branch information
takost authored and TingluoHuang committed Oct 9, 2023
1 parent f47384b commit 972ba23
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/checks/nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `<runner_root>/externals/node16/`.
The runner carries its own copy of node.js executable under `<runner_root>/externals/node20/`.

All javascript base Actions will get executed by the built-in `node` at `<runner_root>/externals/node16/`.
All javascript base Actions will get executed by the built-in `node` at `<runner_root>/externals/node20/`.

> Not the `node` from `$PATH`
Expand Down
2 changes: 1 addition & 1 deletion src/Misc/layoutbin/runsvc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 8 additions & 3 deletions src/Misc/layoutbin/update.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 1 addition & 1 deletion src/Runner.Common/Util/NodeUtil.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> BuiltInNodeVersions = new(new[] { "node16", "node20" });
public static string GetInternalNodeVersion()
{
Expand Down
1 change: 0 additions & 1 deletion src/Runner.Worker/ExecutionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,6 @@ public void InitializeJob(Pipelines.AgentJobRequestMessage message, Cancellation
// Actions environment
ActionsEnvironment = message.ActionsEnvironment;


// Service container info
Global.ServiceContainers = new List<ContainerInfo>();

Expand Down

0 comments on commit 972ba23

Please sign in to comment.