-
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
Error using default cache: ''
option since v3.7.0
#797
Comments
Hello, @colinrotherham ! Thank you for submitting the issue, we will take a closer look at it and see what can be done :) |
Hello @colinrotherham. I took a look at your logs and it looks like that during the post job you have different values because cache-hit does not exist at post job but the cache-hit is true during set up step. |
Thanks for taking a look @dmitry-shibanov Yeah that's right We intentionally set On Windows it's too slow to restore the |
Thank you for your response @colinrotherham. I think it is not the issue from |
Unless I'm reading the log messages wrong they're for our node_modules cache restore? key: npm-install-${{ runner.os }}-${{ hashFiles('package-lock.json', '**/package.json') }} Do you think our cache-hit is true log messages affect Cache restored successfully
Cache restored from key: npm-install-Linux-XXXXXXX
##[debug]Node Action run completed with exit code 0
##[debug]Save intra-action state CACHE_KEY = npm-install-Linux-XXXXXXX
##[debug]Save intra-action state CACHE_RESULT = npm-install-Linux-XXXXXXX
##[debug]Set output cache-hit = true Do our cache key names clash? Composite action inputsOtherwise thanks for pointing out our
We hadn't noticed that the input changed from I presume in We'll harden our checks for Appreciate it |
You didn't face this issue before because previously the action was getting cached paths during the save-step through tools commands.Now the action gets cached paths during the setup steps and pass it to save step that is why now it fails for you because in your case the action during the setup step has empty string for cache but during (no paths for cache were saved) but during post step it gets It was working previously because the action could save the cache because it could get paths and they were not empty because from the initial run of |
Ah that's a great explanation. Hope this helps others that hadn't realised I'll update our input checks to include Will come back and close this issue if it all works Thanks again Update: All working 👍 |
Looks like our `use-cache` input sometimes defaults to null. This hasn’t been an issue before, but it caused problems with `actions/setup-node@3.7.0` See GitHub issue: actions/setup-node#797
Looks like our `use-cache` input sometimes defaults to null. This hasn’t been an issue before, but it caused problems with `actions/setup-node@3.7.0` See GitHub issue: actions/setup-node#797
Looks like our `use-cache` input sometimes defaults to null. This hasn’t been an issue before, but it caused problems with `actions/setup-node@3.7.0` See GitHub issue: actions/setup-node#797
I wonder if it has to do with removing the optional part of this check 8170e22#diff-55f15e2366942ad15f71a41ac983f8ce9a9882b28b7fd9082f3a26c799783064L16 Originally posted by @eddiemonge in #801 (comment) @colinrotherham how did you actually fix it? |
For the cache option you have to default to |
That should really have been a breaking change requiring a bump to version 4 then. |
That did not fix it for me. I'm using a custom reusable action:
The consuming action is:
Output is
|
Sorry it didn't help, this was our fix in alphagov/govuk-frontend@b8165f9 |
Looks like our `use-cache` input sometimes defaults to null. This hasn’t been an issue before, but it caused problems with `actions/setup-node@3.7.0` See GitHub issue: actions/setup-node#797 (cherry picked from commit b8165f9)
Looks like our `use-cache` input sometimes defaults to null. This hasn’t been an issue before, but it caused problems with `actions/setup-node@3.7.0` See GitHub issue: actions/setup-node#797 (cherry picked from commit b8165f9)
Looks like our `use-cache` input sometimes defaults to null. This hasn’t been an issue before, but it caused problems with `actions/setup-node@3.7.0` See GitHub issue: actions/setup-node#797 (cherry picked from commit b8165f9)
Description:
We've noticed that the default
cache: ''
option throws an error since v3.7.0It's documented in
README.md
UsageHope this report helps fix the issue for others. Thanks 😊
Action version:
v3.7.0
Platform:
Runner type:
Tools version:
Node.js v18.16.1 with default npm 9.5.1
Repro steps:
Add a GitHub Action workflow step with the default
cache: ''
optionHere we toggle
inputs.use-cache
to skip cache restoration of/home/runner/.npm
when node_modules is already cached. This speeds up our GitHub Actions workflow runs on WindowsSee the full
action.yml
for more informationHere's our related PR to pin to version v3.6.0 as a fix:
actions/setup-node
to v3.6.0 alphagov/govuk-frontend#3909Expected behavior:
The default
cache: ''
option to continue workingActual behavior:
An error is thrown:
See examples of the error output:
The text was updated successfully, but these errors were encountered: