-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Run action with Node 18 #60
Conversation
JavaScript actions have no way of supporting Node 18. We want to use Node 18 to fix #33. It seems that GitHub will never support `node18` for `actions/runner`, instead jumping straight to Node 20.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this @georgeblahblah ! The linked issue around their plans to migrate to v20 is helpful in motivating this change - as doesn't look like they will update very soon.
I've tested this branch on one of our projects too without issue. And, given there are no actual TS/code changes, think this is good.
Once merged, update the v2 release by something like the following:
git switch main
git pull origin HEAD
git tag v2
git push origin v2 -f
And then also manually create a new v2.2.1
release within the Github UI with a notes on the issue being fixed.
In practice, everyone seems to pin to just the major version (v2
) but additional releases are helpful for those who want a bit more stability.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think composite actions are cooler! 🧊
The `major.minor` version of `@types/node` should match the version of node specified in `.nvmrc`
c4940a1
to
0b31ab1
Compare
Hey all, this is causing https://github.com/guardian/identity/actions/runs/5670168291/attempts/1 |
😱 oh no! #61 should fix that. You can specify |
https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/ looks like GHA support for Node 20 is now available. |
Manually update `dist/index.js` following various dependency updates. Also updates esbuild configuration to target Node 18, following #60.
We migrated to a composite action in #60 in order to run the action's code on Node 18 before it was supported by the action runner. GitHub have since released support for runners on Node 20.
* Switch from a composite action to a Node 20 Javascript action We migrated to a composite action in #60 in order to run the action's code on Node 18 before it was supported by the action runner. GitHub have since released support for runners on Node 20.
Why are you making this change?
During the migration work to build Frontend with GitHub Actions instead of TeamCity (guardian/frontend#26058), artifact upload using
actions-riff-raff
would sometimes fail. The failure is caused by a known issue in@aws-sdk/client-s3
, which is fixed from Node 18.6.0.Currently,
actions-riff-raff
is a Javascript action. Javascript actions only support Node 12 and Node 16 runtimes and GitHub are not planning to support Node 18, instead planning support for Node 20 at some point later this year (actions/runner#2704).Given the upcoming deprecation of TeamCity and the bug in uploading artifacts to S3 with
@aws-sdk/client-s3
in Node 16, this change convertsactions-riff-raff
to a composite action. Using a composite action, we can run the action using Node 18. The main drawback to this approach is having to copy all of the action's inputs to the executing shell's environment.Once
actions/runner
supports Node 20, we could revert this change and go back to using a Javascript Action.Resolves #33.
What does this change?
18.17.0
@types/node@18.17.0
. Themajor.minor
version of@types/node
should match themajor.minor
version of node specified in.nvmrc
(thx @mxdvl for showing me this!)composite
action which executesdist/index.js
using the node version defined in.nvmrc
. This requires copying all the action inputs to the shell's environmentHow to test
I haven't figured out a thorough way of validating this change, but anecdotally I have noticed that the S3 upload error doees not occur following this change 1.
Footnotes
https://github.com/guardian/frontend/actions/runs/5666984810/job/15354810970?pr=26058 ↩