README: clarify that cache-hit returns a string and not a boolean#1263
Closed
andreasabel wants to merge 2 commits intoactions:mainfrom
Closed
README: clarify that cache-hit returns a string and not a boolean#1263andreasabel wants to merge 2 commits intoactions:mainfrom
cache-hit returns a string and not a boolean#1263andreasabel wants to merge 2 commits intoactions:mainfrom
Conversation
miparnisari
approved these changes
Nov 22, 2023
Author
|
@bethanyj28 : Anything left to do here? |
itchyny
reviewed
Mar 20, 2024
README.md
Outdated
| * `cache-hit` - A string `'true'` or `'false'` indicating whether an exact match was found for the key. | ||
|
|
||
| > **Note** `cache-hit` will only be set to `true` when a cache hit occurs for the exact `key` match. For a partial key match via `restore-keys` or a cache miss, it will be set to `false`. | ||
| > **Note** `cache-hit` will only be set to `'true'` when a cache hit occurs for the exact `key` match. For a partial key match via `restore-keys` or a cache miss, it will be set to `'false'`. |
There was a problem hiding this comment.
This is still incorrect. On a cache miss, the output is not set, i.e. empty string.
Author
There was a problem hiding this comment.
@itchyny So you are saying it is three-valued, 'true', 'false' or empty?
There was a problem hiding this comment.
@andreasabel Exactly. A bit surprising behavior though. See https://github.com/itchyny/actions-cache-issues-1263/actions/runs/8385497449.
Author
There was a problem hiding this comment.
Thanks for the thorough investigation @itchyny ! I updated the text accordingly.
Rationale: if `cache-hit` was a boolean, then `!` could be used to get the opposite. However, it is really a string, and this should be pointed out clearly in the documentation. Because both `!'true'` and `!'false'` are `false`, so customers can shoot themselves in the foot here. Closes actions#1262.
6710a4f to
3182ee5
Compare
10 tasks
Contributor
|
👋 Hey @andreasabel thank you for these changes! I'm updating the README to reflect this behavior as part of a bug fix in #1467 |
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rationale: if
cache-hitwas a boolean, then!could be used to get the opposite.However, it is really a string, and this should be pointed out clearly in the documentation.
Because both
!'true'and!'false'arefalse, so customers can shoot themselves in the foot here.Closes #1262.