AnimMouse / setup-rclone

Setup/Install Rclone for GitHub Actions
https://github.com/marketplace/actions/setup-rclone-action
Mozilla Public License 2.0
37 stars 9 forks source link

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

Closed lenalebt closed 3 days ago

lenalebt commented 3 days ago

Just FYI, a release to actions-cache v4.1.0 breaks this plugin. See https://github.com/actions/cache/issues/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 commented 3 days ago

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 commented 3 days ago

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 commented 3 days ago

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 commented 3 days ago

Holy shit! It's 2024, and GitHub Actions still can't make their type system right! https://github.com/actions/cache/issues/1262#issuecomment-1765308602 https://github.com/actions/runner/issues/2238#issuecomment-2157289150 https://github.com/actions/runner/issues/1483 https://github.com/actions/cache/pull/1404

AnimMouse commented 3 days ago

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

AnimMouse commented 3 days ago

https://github.com/actions/cache/pull/1404 has now been reverted by https://github.com/actions/cache/pull/1467.

lenalebt commented 1 day ago

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 commented 14 hours ago

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.