Conversation
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Node 20 to Node 24 Migration Strategy
This is a proposal for the migration strategy, nothing here is 100% confirmed yet.
Overview
This PR implements the migration strategy for GitHub Actions JavaScript/TypeScript actions from Node 20 to Node 24, preparing for Node 20's end of life. The approach uses feature flags for a phased rollout, similar to the previous Node 16 to Node 20 migration.
Key Features
Migration Phases
Phase 1: Node 20 Default
Initially Node 20 remains the default:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=truePhase 2: Node 24 Default
When the
actions.runner.usenode24bydefaultflag is enabled:ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=truePhase 3: Node 24 Required
When the
actions.runner.requirenode24flag is enabled:Environment Variables
The migration uses two environment variables:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true: Opt into Node 24 during Phase 1ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true: Fall back to Node 20 during Phase 2These can be set at either the workflow level (in YAML) or runner level (system environment). Workflow settings override runner settings to ensure job-specific control.
Implementation Details
Core Components
The migration strategy includes:
Centralized Constants
Node20andNode24Version Selection Logic
User Feedback
Platform Compatibility
Testing & Compatibility
Tests cover:
Backward compatibility is maintained through:
Node Version Selection Logic - Truth Table
Variable Precedence
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24andACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION) is evaluated independentlyPhase 1: Node 20 Default (No Feature Flags)
Phase 2: Node 24 Default (useNode24ByDefault=true)
Phase 3: Node 24 Required (requireNode24=true)
In Phase 3, the environment variables are ignored and Node 24 is always used.
Notable Edge Cases
1. Mixed-Source Variables (Workflow vs System)
When variables come from different sources, each is evaluated independently:
Example: ForceNode24=false (Workflow), AllowUnsecure=true (System)
Example: AllowUnsecure=false (Workflow), ForceNode24=true (System)
Key Edge Case in Phase 2: When both variables are true (from any sources)
2. Conflicting Settings
When both variables are set to true from the same source (both from workflow or both from system):
3. ARM32 Linux Platform Compatibility
For Linux ARM32 platforms, Node 24 is not supported:
4. Phase 2 User Notification
In Phase 2, when Node 24 is selected:
Environment Variable Examples
Opt-in to Node 24 using workflow environment variable
You can opt in to Node 24 during Phase 1 by adding the environment variable to your workflow:
This forces actions like
actions/checkout@v4(which normally uses Node 20) to run with Node 24 instead:Opt-in to Node 24 using system environment variable
You can also opt in at the runner level by setting the system environment variable:
This is how it behaves when node24 is default
When node24 is default, actions can be opted out using the
ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSIONenvironment variableACTIONS_ALLOW_USE_UNSECURE_NODE_VERSIONFor example:
Environment Variable Precedence
When both system-level and workflow-level environment variables are set:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true, Node 24 is usedACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION=true, Node 20 is used