FORCE_JAVASCRIPT_ACTIONS_TO_NODE20 has no effect #113020
Unanswered
EliahKagan
asked this question in
Actions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Select Topic Area
Bug
Body
About ten days ago, on 7 March 2024, the GitHub changelog post GitHub Actions; All Actions will run on Node20 instead of Node16 by default documented the effect of setting the
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20
environment variable totrue
for a workflow:It seems to me that the way this uses "now" unambiguously expresses that setting this environment variable is currently effective at causing actions that specify Node 16 to be run on Node 20 instead, and can therefore already be relied on to check actions' compatibility with Node 20 and make decisions based on the results.
Searching public code and pull requests across GitHub for
FORCE_JAVASCRIPT_ACTIONS_TO_NODE20
suggests that there are at least a few cases where this may have been assumed. I had assumed it myself, but I wanted to check to be sure, because it looks like this was implemented in actions/runner#3192, which was only merged a few days ago, on 14 March 2024, and there has not been any new release of actions/runner since then, the most recent release currently being v2.314.1 on 27 February 2024.The version of Node being used is often not immediately clear in examining workflow results, even when debug logging is enabled (or perhaps I just don't know where to look for it). So I tested this by:
process.version
for the Node version, as well asprocess.env['FORCE_JAVASCRIPT_ACTIONS_TO_NODE20']
to ensure the environment variable was coming through. (The latter may not really be a sufficient check, since the environment variable is not documented to have an effect at the job or step level, but I also verified that I had placed it at the workflow level.) The Node version was still 16.github-script
action, passing a script that accessesprocess.version
. This likewise reported Node 16.When setting
env
for the workflows, I wrote the values as strings because environment variables' values are inherently strings rather than booleans. But I have also separately tested this with a variety of expressions of "true", including writing it as a boolean (even though it will still be converted to a string) and using "1". None affect the Node version.As I suggested above, I think the reason is simply that the version of actions/runner that honors this variable has not yet been released (nor otherwise put into use on GitHub's own infrastructure). However, the post in the GitHub changelog blog does strongly seem to indicate this is in place now, so I wanted to check. If I'm making a mistake here and really this is working but I'm doing something wrong, then thank you for bearing with me. Otherwise, I think it might be worthwhile to make a correction to the blog post so that anyone who believes they have tested the effect of running their workflows with all JavaScript actions running on Node 20 can know to test again once the feature to do so is in place.
Beta Was this translation helpful? Give feedback.
All reactions