Skip to content

Commit

Permalink
Revert "Update default version to node20 (#2844)" (#2918)
Browse files Browse the repository at this point in the history
This reverts commit acdc6ed.
  • Loading branch information
takost committed Oct 10, 2023
1 parent c851794 commit 544f190
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 13 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/node20/`.
The runner carries its own copy of node.js executable under `<runner_root>/externals/node16/`.

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

> 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:-node20}
nodever=${GITHUB_ACTIONS_RUNNER_FORCED_NODE_VERSION:-node16}

# insert anything to setup env when running as a service
# run the host process which keep the listener alive
Expand Down
11 changes: 3 additions & 8 deletions src/Misc/layoutbin/update.sh.template
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,12 @@ 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="node20"
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 node16
if [[ $? -ne 0 || -z "$path" ]] # Fallback if RunnerService.js was started with node12
then
nodever="node16"
nodever="node12"
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 "node16" 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 "node12" 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 = "node20";
private const string _defaultNodeVersion = "node16";
public static readonly ReadOnlyCollection<string> BuiltInNodeVersions = new(new[] { "node16", "node20" });
public static string GetInternalNodeVersion()
{
Expand Down
1 change: 1 addition & 0 deletions src/Runner.Worker/ExecutionContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,7 @@ 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 544f190

Please sign in to comment.