-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Upgrade to v2.3/v2.4 results in post-setup failure #317
Comments
+1 |
+1
|
Hello everyone. Thank you for your report. The action on post-step fails If caching directory does not exists, that is why it has nothing to cache. The action throws an error to prevent saving empty folder. |
Just a gentle ping. |
Frankly, I was patiently waiting for a fix... Are you expecting us to do something about it? I don't think we can, since the post-step is not something the action users have any control over. |
The current behavior is expected and correct. We don't have plans to change it. If |
Doesn't this strip If so, I feel we may have lost something valuable here.
I personally would prefer the previous behavior, as I don't want to have to worry about whether or not setting the cache flag on Here's a workaround I'm using for now, FWIW: # Workaround to avoid Post Use step failures. See: https://github.com/actions/setup-node/issues/317
- run: mkdir -p /home/runner/.cache/yarn/v6
continue-on-error: true Appreciate your continued investment in this project, Dmitry and team! 🙇 🙏 |
@dmitry-shibanov Finally, I had a chance to dive a bit deeper into the issue and add some debugging to the action upgrade PR. I see that Yarn cache exists, but post-setup is unable to find it (as you can see on the screenshot below). How do you suggest to proceed with that? |
Hello @khitrenovich. Could you please provide repro steps or public repository ? I've tried to reproduce by my own, but it works as expected. |
@dmitry-shibanov I was able to eliminate the failure after removing
setting from the job that was failing in the upgrade PR. My guess would be that the action relies on running terminal commands and parsing the output, which might be affected by the terminal settings. Removing the setting may provide a workaround, but making this a permanent limitation will be pretty inconvenient. Here is the minimal workflow that will reproduce the issue on any Yarn-based repository:
|
Hello @khitrenovich. Thank you for your response. I think it's known problem. We had a similar issue. Please take a look and feel free to contact us if you have any questions. |
Oh, good to know. Thank you for the reference! |
Hi @dmitry-shibanov, considering this is a known problem, do you would have sense to revisit this and prevent user's using |
refs #13716 refs actions/setup-node#317 (comment) - the `setup-node` GitHub Action seems to use a shell command to get the cache path, but these are colorised when `FORCE_COLOR` is enabled - this causes the Action to fail to read the path correctly - the comment referenced above suggests to remove `FORCE_COLOR` but it's nice to have colored output for our tests - instead, I'm disabling the environment variable on the `setup-node` action so it still works - I've tested with the referenced PR and this unblocks dependency caching 🎉
If you're using NPM (and not Yarn), I modified @byrondover's solution to make it work for our use case:
|
Here's another workaround (thanks @daniellockyer!) TryGhost/Ghost@aec14e5 - uses: actions/setup-node@v3
+ env:
+ FORCE_COLOR: 0 Rather than users having to disable colour output for the whole workflow (makes reading logs and diagnosing problems harder), or having to disable it for just the step as shown here, how about |
* Remove unused main2 merge workflow * Pin Node version in GitHub workflows to 16, fixup caching * Bring Node 16 @types/node up to date * Work around a dumb bug actions/setup-node#317
try suggested fix from actions/setup-node#317
Bumps [husky](https://github.com/typicode/husky) from 7.0.2 to 7.0.4. - [Release notes](https://github.com/typicode/husky/releases) - [Commits](typicode/husky@v7.0.2...v7.0.4) --- updated-dependencies: - dependency-name: husky dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Currently, the docs build check action fails. The reason is that setup-node with yarn caching throws an error when yarn cache directory doesn't exist. The action throws an error to prevent saving empty folder, see actions/setup-node#317. This PR is a workaround for that.
We are using
actions/setup-node
v2.2 in Yarn-based monorepo. We attempted upgrade to v2.3 and v2.4, but the updated version fails with errorError: Cache folder path is retrieved for yarn but doesn't exist on disk
in post-setup step in workflows that also runyarn install
command. (We have a workflow that runsyarn audit
without actually installing the dependencies. and an upgrade to v2.3/v2.4 passes there without failures.)Our usage:
Logs from "Setup Node" step (identical for passing and failing builds):
Logs from "Post Setup Node" in successful v2.4 run:
Logs from "Post Setup Node" in failed v2.4 run:
The text was updated successfully, but these errors were encountered: