Skip to content

Commit

Permalink
fix(action): clarify restore input descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
deemp committed Aug 26, 2024
1 parent fd385a4 commit 61dfcb4
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 27 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ See [action.yml](action.yml).
| name | description | required | default |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | --------------------- |
| `primary-key` | <ul> <li>When a non-empty string, the action uses this key for restoring and saving a cache.</li> <li>Otherwise, the action fails.</li> </ul> | `true` | `""` |
| `restore-prefixes-first-match` | <ul> <li>When a newline-separated non-empty list of non-empty key prefixes, when there's a miss on the <code>primary-key</code>, the action searches in this list for the first prefix for which there exists a cache with a matching key and the action tries to restore that cache.</li> <li>Otherwise, this input has no effect.</li> </ul> | `false` | `""` |
| `restore-prefixes-all-matches` | <ul> <li>When a newline-separated non-empty list of non-empty key prefixes, the action tries to restore all caches whose keys match these prefixes.</li> <li>Tries caches across all refs to make use of caches created on the current, base, and default branches (see <a href="https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache">docs</a>).</li> <li>Otherwise, this input has no effect.</li> </ul> | `false` | `""` |
| `skip-restore-on-hit-primary-key` | <ul> <li>Can have an effect only when <code>restore-prefixes-first-match</code> has no effect.</li> <li>When <code>true</code>, when there's a hit on the <code>primary-key</code>, the action doesn't restore caches.</li> <li>Otherwise, the action restores caches.</li> </ul> | `false` | `false` |
| `restore-prefixes-first-match` | <ul> <li>When a newline-separated non-empty list of non-empty key prefixes, when there's a miss on the <code>primary-key</code>, the action searches in this list for the first prefix for which there exists a cache whose key has this prefix, and the action tries to restore that cache.</li> <li>Otherwise, this input has no effect.</li> </ul> | `false` | `""` |
| `restore-prefixes-all-matches` | <ul> <li>When a newline-separated non-empty list of non-empty key prefixes, when there's a miss on the <code>primary-key</code>, the action tries to restore all caches whose keys have these prefixes.</li> <li>Tries caches across all refs to make use of caches created on the current, base, and default branches (see <a href="https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache">docs</a>).</li> <li>Otherwise, this input has no effect.</li> </ul> | `false` | `""` |
| `skip-restore-on-hit-primary-key` | <ul> <li>When <code>true</code>, when there's a hit on the <code>primary-key</code>, the action doesn't restore the found cache.</li> <li>Otherwise, the action restores the cache.</li> </ul> | `false` | `false` |
| `fail-on` | <ul> <li>Input form: <code>&lt;key type&gt;.&lt;result&gt;</code>.</li> <li><code>&lt;key type&gt;</code> options: <code>primary-key</code>, <code>first-match</code>.</li> <li><code>&lt;result&gt;</code> options: <code>miss</code>, <code>not-restored</code>.</li> <li>When the input satisfies the input form, when the event described in the input happens, the action fails.</li> <li>Example:<ul> <li>Input: <code>primary-key.not-restored</code>.</li> <li>Event: a cache could not be restored via the <code>primary-key</code>.</li></ul></li> <li>Otherwise, this input has no effect.</li> </ul> | `false` | `""` |
| `nix` | <ul> <li>Can have an effect only when the action runs on a <code>Linux</code> or a <code>macOS</code> runner.</li> <li>When <code>true</code>, the action can do Nix-specific things.</li> <li>Otherwise, the action doesn't do them.</li> </ul> | `false` | `true` |
| `save` | <ul> <li>When <code>true</code>, the action can save a cache with the <code>primary-key</code>.</li> <li>Otherwise, the action can't save a cache.</li> </ul> | `false` | `true` |
Expand Down
15 changes: 8 additions & 7 deletions action.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,16 @@ in
${restore-prefixes-first-match}:
description: |
- ${whenListOf} key prefixes, when there's a miss on the ${q primary-key},
the action searches in this list for the first prefix for which there exists a cache
with a matching key and the action tries to restore that cache.
the action searches in this list for the first prefix
for which there exists a cache whose key has this prefix,
and the action tries to restore that cache.
- ${noEffectOtherwise}
default: ""
restore-prefixes-all-matches:
description: |
- ${whenListOf} key prefixes, the action tries to restore
all caches whose keys match these prefixes.
- ${whenListOf} key prefixes, when there's a miss on the ${q primary-key},
the action tries to restore all caches whose keys have these prefixes.
- Tries caches across all refs to make use of caches created
on the current, base, and default branches
(see [docs](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache)).
Expand All @@ -89,9 +91,8 @@ in
skip-restore-on-hit-primary-key:
description: |
- Can have an effect only when ${q restore-prefixes-first-match} has no effect.
- When `true`, when there's a hit on the ${q primary-key}, the action doesn't restore caches.
- Otherwise, the action restores caches.
- When `true`, when there's a hit on the ${q primary-key}, the action doesn't restore the found cache.
- Otherwise, the action restores the cache.
default: "false"
fail-on:
Expand Down
15 changes: 8 additions & 7 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ inputs:
restore-prefixes-first-match:
description: |
- When a newline-separated non-empty list of non-empty key prefixes, when there's a miss on the `primary-key`,
the action searches in this list for the first prefix for which there exists a cache
with a matching key and the action tries to restore that cache.
the action searches in this list for the first prefix
for which there exists a cache whose key has this prefix,
and the action tries to restore that cache.
- Otherwise, this input has no effect.
default: ""

restore-prefixes-all-matches:
description: |
- When a newline-separated non-empty list of non-empty key prefixes, the action tries to restore
all caches whose keys match these prefixes.
- When a newline-separated non-empty list of non-empty key prefixes, when there's a miss on the `primary-key`,
the action tries to restore all caches whose keys have these prefixes.
- Tries caches across all refs to make use of caches created
on the current, base, and default branches
(see [docs](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache)).
Expand All @@ -27,9 +29,8 @@ inputs:

skip-restore-on-hit-primary-key:
description: |
- Can have an effect only when `restore-prefixes-first-match` has no effect.
- When `true`, when there's a hit on the `primary-key`, the action doesn't restore caches.
- Otherwise, the action restores caches.
- When `true`, when there's a hit on the `primary-key`, the action doesn't restore the found cache.
- Otherwise, the action restores the cache.
default: "false"

fail-on:
Expand Down
Loading

0 comments on commit 61dfcb4

Please sign in to comment.