Skip to content
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

Update to actions/cache outputs cache-hit as string instead of boolean #10

Closed
lenalebt opened this issue Oct 8, 2024 · 8 comments
Closed
Labels
bug Something isn't working

Comments

@lenalebt
Copy link
Contributor

lenalebt commented Oct 8, 2024

Just FYI, a release to actions-cache v4.1.0 breaks this plugin. See actions/cache#1466

This is the output I am seeing:

Run AnimMouse/setup-rclone@v1.10.1
Run $GITHUB_ACTION_PATH/scripts/version/Unix-like.sh
Run actions/cache/restore@v4
Cache not found for input keys: Rclone-v1.64.0-Linux-X64
Run AnimMouse/tool-cache@v1
Run $GITHUB_ACTION_PATH/scripts/install/Unix-like.sh
Installing Rclone to tool cache
  mv: cannot stat '/home/github_runner/actions-runner/_work/_temp/Rclone/*': No such file or directory

This could be fixed by setting it fixed in this plugin to 4.0.2, or wait for a release of actions/cache. Any idea for a workaround in the meantime?

@lenalebt
Copy link
Contributor Author

lenalebt commented Oct 8, 2024

The relevant part of the log with debugging enabled, which shows it basically skips downloading the tool where it should download it:

##[debug]Evaluating condition for step: 'run'
##[debug]Evaluating: (success() && ((runner.os == 'Linux') || (runner.os == 'macOS')) && !steps.cache.outputs.cache-hit)
##[debug]Evaluating And:
##[debug]..Evaluating success:
##[debug]..=> true
##[debug]..Evaluating Or:
##[debug]....Evaluating Equal:
##[debug]......Evaluating Index:
##[debug]........Evaluating runner:
##[debug]........=> Object
##[debug]........Evaluating String:
##[debug]........=> 'os'
##[debug]......=> 'Linux'
##[debug]......Evaluating String:
##[debug]......=> 'Linux'
##[debug]....=> true
##[debug]..=> true
##[debug]..Evaluating Not:
##[debug]....Evaluating Index:
##[debug]......Evaluating Index:
##[debug]........Evaluating Index:
##[debug]..........Evaluating steps:
##[debug]..........=> Object
##[debug]..........Evaluating String:
##[debug]..........=> 'cache'
##[debug]........=> Object
##[debug]........Evaluating String:
##[debug]........=> 'outputs'
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'cache-hit'
##[debug]....=> 'false'
##[debug]..=> false
##[debug]=> false
##[debug]Expanded: (true && (('Linux' == 'Linux') || (runner['os'] == 'macOS')) && !'false')
##[debug]Result: false

Another option would be to specifically check for the string-return case.

@lenalebt
Copy link
Contributor Author

lenalebt commented Oct 8, 2024

Seems to be an intended change, so checking for string 'false' seems to be what they want us to do. I'll make a PR to fix it, as it breaks many of my workflows.

lenalebt added a commit to lenalebt/setup-rclone that referenced this issue Oct 8, 2024
@lenalebt
Copy link
Contributor Author

lenalebt commented Oct 8, 2024

In case anyone needs a temporary workaround: Using lenalebt/setup-rclone@main should work. I do not intend to do further updates over there, so switch back as soon as it's fixed over here :-)

@AnimMouse
Copy link
Owner

AnimMouse commented Oct 8, 2024

Holy shit! It's 2024, and GitHub Actions still can't make their type system right!
actions/cache#1262 (comment)
actions/runner#2238 (comment)
actions/runner#1483
actions/cache#1404

AnimMouse added a commit that referenced this issue Oct 8, 2024
@AnimMouse AnimMouse reopened this Oct 8, 2024
@AnimMouse
Copy link
Owner

I'm keeping this open to track GitHub Actions' type system stupidity.

@AnimMouse AnimMouse added the bug Something isn't working label Oct 8, 2024
@AnimMouse AnimMouse changed the title Update to actions/cache breaks this plugin Update to actions/cache outputs cache-hit as string instead of boolean Oct 8, 2024
@AnimMouse
Copy link
Owner

actions/cache#1404 has now been reverted by actions/cache#1467.

@lenalebt
Copy link
Contributor Author

Yeah, well, the solution I started and you completed should work in both cases, so I think we're good :-). We'll see whether it will be a problem again.

@AnimMouse
Copy link
Owner

I think they have now learned their lesson on not to push breaking changes on minor version.
I also plan to revert the temporary fix in order not to bloat the codebase.
They also plan to make cache-hit to output as a string in the next major version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants