FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

README: clarify that `cache-hit` returns a string and not a boolean by andreasabel · Pull Request #1263 · actions/cache · GitHub

/ cache Public

README: clarify that cache-hit returns a string and not a boolean - #1263

Closed
andreasabel wants to merge 2 commits into
actions:mainfrom
andreasabel:cache-hit-README
Closed

README: clarify that cache-hit returns a string and not a boolean#1263
andreasabel wants to merge 2 commits into
actions:mainfrom
andreasabel:cache-hit-README

Conversation

Copy link
Copy Markdown

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 #1262.

Copy link
Copy Markdown
Author

@bethanyj28 : Anything left to do here?

Comment thread 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'`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is still incorrect. On a cache miss, the output is not set, i.e. empty string.

andreasabel Mar 21, 2024
edited
Loading

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

@itchyny So you are saying it is three-valued, 'true', 'false' or empty?

itchyny Mar 22, 2024
edited
Loading

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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.

Copy link
Copy Markdown
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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

!cache-hit is false when cache-hit is false

4 participants


Back | FazBrowse Home | New Git URL