-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
Summary
When FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true is set in a workflow's env: section, JavaScript actions with using: node20 are correctly upgraded to run on Node 24 at runtime — but the end-of-job deprecation annotation still fires with the misleading message:
The following actions are running on Node.js 20 and may not work as expected:
some-action@v1
The action is not actually running on Node 20. The annotation text is inaccurate.
Root cause
In HandlerFactory.cs, the deprecation tracking happens before DetermineActionsNodeVersion is called:
// 1. Deprecation tracking — based on declared version, runs FIRST
if (nodeData.NodeVersion == "node20") {
if (warnOnNode20)
executionContext.Global.DeprecatedNode20Actions?.Add(actionName); // always added
}
// 2. Version upgrade check — runs SECOND, may upgrade to node24
if (nodeData.NodeVersion == "node20") {
var (nodeVersion, _) = NodeUtil.DetermineActionsNodeVersion(environment, ...);
nodeData.NodeVersion = finalNodeVersion; // could be "node24" if FORCE_ is set
}The action is added to DeprecatedNode20Actions based on its declared version (node20) before DetermineActionsNodeVersion has a chance to check the FORCE_JAVASCRIPT_ACTIONS_TO_NODE24 env var and upgrade the runtime to node24. The end-of-job warning then iterates over that list and claims the actions "are running on Node.js 20", even though they ran on Node 24.
Expected behavior
If FORCE_JAVASCRIPT_ACTIONS_TO_NODE24=true causes an action to run on Node 24, the end-of-job annotation should either:
- Not fire at all for that action (preferred — the user has already opted in), or
- Use accurate language like "declared for Node.js 20" rather than "running on Node.js 20"
Steps to reproduce
- Set
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"at the workflowenv:level - Use any action that declares
using: node20in itsaction.yml - Observe that the "Complete job" step still emits the Node 20 deprecation annotation
Suggested fix
Move the deprecation tracking to after DetermineActionsNodeVersion resolves the final runtime version, so the warning only fires for actions that will actually execute on Node 20:
// Determine actual runtime version first
if (nodeData.NodeVersion == "node20") {
var (nodeVersion, _) = NodeUtil.DetermineActionsNodeVersion(environment, ...);
nodeData.NodeVersion = finalNodeVersion;
}
// Only warn if the action is still going to run on node20
if (nodeData.NodeVersion == "node20") {
if (warnOnNode20)
executionContext.Global.DeprecatedNode20Actions?.Add(actionName);
}