octokit / octokit.js

The all-batteries-included GitHub SDK for Browsers, Node.js, and Deno.
MIT License
6.93k stars 1.01k forks source link

[BUG]: minimum version of node (node 18) is higher than available in github actions (node 16) #2505

Closed AWare closed 1 year ago

AWare commented 1 year ago

What happened?

Currently the maximum version of node supported in a github action is 16.

https://github.com/actions/runner/discussions/2704

Using this gives an error as per https://github.com/octokit/octokit.js/issues/2497

It's very frustrating that these two major github products have incompatible node versions.

Please can support for node 16 be retained until a later version is made available on gha?

Versions

n/a

Relevant log output

No response

Code of Conduct

wolfy1339 commented 1 year ago

This was an intentional change. We have the @octokit/action package that currently supports NodeJS 16 for the time being that is intended to be used on GitHub actions

wolfy1339 commented 1 year ago

If you can, you can simply run your JS code using the @actions/setup-node action to use Node v18

AWare commented 1 year ago

while a good workaround is linked in the discussion (https://github.com/actions/runner/discussions/2704#discussioncomment-6540892) we use actions extensively and this represents a not insignificant refactor.

while this was an intentional change, it is not reasonable for github to have different nodejs supported versions for two major products that would foreseeably be used together

@wolfy1339 thank you for the response though, I appreciate your work as a volunteer. and my displeasure is entirely at github product management for allowing this incompatibility to occur.

VictorChacon-Ada commented 1 year ago

Hello, I just tried to use the @octokit/action package to workaround this issue, but even in that I get a compatibility issue on @octokit/plugin-paginate-rest@8.0.0.

nickfloyd commented 1 year ago

Hey @VictorChacon-Ada so sorry for the trouble you're experiencing. Would you be able to share a repo, or actions yaml, or more details so that we can get a better idea of what is going on? Thanks. I hope to hear from you soon!

VictorChacon-Ada commented 1 year ago

I don't have a specific repo example, I was working on a brand new action. I'm running node v16.16.0. If I start a brand new project with yarn init and then yarn add @octokit/action, I get the error

@octokit/plugin-rest-endpoint-methods@9.0.0: The engine "node" is incompatible with this module. Expected version ">= 18". Got "16.16.0"

If I manually set the version to 4.x, the package is succesfully installed, but I expected this specific package to still be compatible with the only current node version available in github actions.

nickfloyd commented 1 year ago

Hey @VictorChacon-Ada

Thanks for getting back to us. Thanks for the explanation. We'll have a look at things using the details you provided to see if we can get a better picture of what might be going on. We're a little short handed this week but I'll see if I can get something worked out and reach back out next week at the latest.

Again, apologies for the trouble here.

nickfloyd commented 1 year ago

while this was an intentional change, it is not reasonable for github to have different nodejs supported versions for two major products that would foreseeably be used together

Hey @AWare,

Thank you for the candor and perspective here. I'm sorry that the way this change was done has made things problematic for you. While there are work arounds, you are correct, this could've gone a bit smoother. For Octokit.js we had to make a decision to move forward given we were using an EoL version such as v14.

We are really sorry for the trouble and want you to know that we are doing our best to make processes better by having actionable discussions like this and this to help everyone navigate things like coordinated dependencies and breaking changes - both internally and externally.

We take your comments to ❤️ and are grateful that you are part of this community making it better.

nickfloyd commented 1 year ago

@VictorChacon-Ada I haven't had a chance to have a look at this yet, but now that @kfcampbell is back this week we should be able to take a look shortly.

kfcampbell commented 1 year ago

@VictorChacon-Ada what version of Yarn and Node are you using? I'm unable to reproduce that case locally using Yarn v1.22.19 and Node v18.14.2. If you're seeing that error on GitHub Actions runners, can you use actions/setup-node to install Node v18 beforehand?

VictorChacon-Ada commented 1 year ago

@kfcampbell the problem I had was running Node v16.6.0, with yarn v1.22.15. For now, I have used the workaround of wrapping my action as a composite action, and using setup-node for node 18 before. But by the previous messages in this thread, I understood that the package @octokit/action should still work with node 16.

AWare commented 1 year ago

node 20 is now available as a target, so I think this issue can probably be closed

wolfy1339 commented 1 year ago

Closing as per the latest comment. Node JS 20 is now avaiable as a target on GitHub Actions Runners