awalsh128 / cache-apt-pkgs-action

Cache APT packages in GitHub Actions
Other
205 stars 35 forks source link

Debug input param doesn't disable/enable properly. #86

Closed ButterscotchV closed 1 year ago

ButterscotchV commented 1 year ago

The workflow file related to this issue can be found at https://github.com/SlimeVR/SlimeVR-Server/actions/runs/3911317186/workflow This workflow is being run on the ubuntu-20.04 container with awalsh128/cache-apt-pkgs-action@latest.

I'm unsure what the cause of this is, but you can see it at:

lihop commented 1 year ago

I have also encountered this issue.

Running a workflow with debug logging enabled shows that the if condition for the upload-logs step always gets evaluated to a truthy string:

##[debug]Evaluating condition for step: 'run'
##[debug]Evaluating: (success() && format('{0} == "true"', inputs.debug))
##[debug]Evaluating And:
##[debug]..Evaluating success:
##[debug]..=> true
##[debug]..Evaluating format:
##[debug]....Evaluating String:
##[debug]....=> '{0} == "true"'
##[debug]....Evaluating Index:
##[debug]......Evaluating inputs:
##[debug]......=> Object
##[debug]......Evaluating String:
##[debug]......=> 'debug'
##[debug]....=> 'false'
##[debug]..=> 'false == "true"'
##[debug]=> 'false == "true"'
##[debug]Expanded: (true && 'false == "true"')
##[debug]Result: 'false == "true"'
##[debug]Starting: run

I've opened a PR to fix this: #87.

ButterscotchV commented 1 year ago

Just gonna note quickly that #87 does not fully resolve this issue, as the first bullet will still be incorrect since inputs.version is resolved to true, which is odd.

lihop commented 1 year ago

@ButterscotchV Thanks for noting this. I've removed "Fixes #86" from the PR and commit message so that it won't close this issue if merged.

awalsh128 commented 1 year ago

Sorry for the lag. Going through backlog right now and issued a new patch v1.2.3 that rolled up the PR here. Also working through a fix for #84; ongoing work is in the dev branch.

@ButterscotchV could you clarify what you mean about inputs.version evaluating to true? AFAIK, version bumps have forced cache updates properly.

ButterscotchV commented 1 year ago

I'm really not sure if it's a problem, but just at quick observation from the GitHub Actions output, it looks like it's resolving to true rather than 1.0 as I'd expect as I've defined in my workflow file.

Hopefully these screenshots can show what I mean a little better, you can see I have the version set to 1.0 but the output is true. I'm assuming it may be getting evaluated as a boolean, as if 1.0 were to be evaluated as a boolean, you would see true as the output.

Here are screenshots presented in the same order as I listed them in the issue: From the GitHub Actions run: image From the actions.yml file in this repo: image From the GitHub Actions workflow file on my repo: image

awalsh128 commented 1 year ago

The first screenshot is for the post_cache_action.sh and the other is for pre_cache_action.sh. 😸

ButterscotchV commented 1 year ago

Ah yep, you're quite right on that, it looks like it's working fine if I'm actually looking at the right one lol. Everything looks all good now, thank you!

awalsh128 commented 1 year ago

No problem. 👍