-
Notifications
You must be signed in to change notification settings - Fork 7
/
action.yml
122 lines (109 loc) · 4.49 KB
/
action.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: "Restore Nix store"
description: "Restore Nix store using GitHub Actions cache to speed up workflows."
author: "GitHub"
inputs:
primary-key:
description: |
- When a non-empty string, the action uses this key for restoring a cache.
- Otherwise, the action fails.
required: true
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.
- 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.
- 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)).
- Otherwise, this input has no effect.
default: ""
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, this input has no effect.
default: "false"
fail-on:
description: |
- Input form: `<key type>.<result>`.
- `<key type>` options: `primary-key`, `first-match`.
- `<result>` options: `miss`, `not-restored`.
- When the input satisfies the input form, when the event described in the input happens, the action fails.
- Example:
- Input: `primary-key.not-restored`.
- Event: a cache could not be restored via the `primary-key`.
- Otherwise, this input has no effect.
default: ""
nix:
description: |
- Can have an effect only when the action runs on a `Linux` or a `macOS` runner.
- When `true`, the action can do Nix-specific things.
- Otherwise, the action doesn't do them.
default: "true"
save:
description: |
- When `true`, the action can save a cache with the `primary-key`.
- Otherwise, the action can't save a cache.
default: "true"
paths:
description: |
- When `nix: true`, the action uses `["/nix", "~/.cache/nix", "~root/.cache/nix"]` as default paths, as suggested [here](https://github.com/divnix/nix-cache-action/blob/b14ec98ae694c754f57f8619ea21b6ab44ccf6e7/action.yml#L7).
- Otherwise, the action uses an empty list as default paths.
- When a newline-separated non-empty list of non-empty path patterns (see [`@actions/glob`](https://github.com/actions/toolkit/tree/main/packages/glob) for supported patterns), the action appends it to default paths and uses the resulting list for restoring caches.
- Otherwise, the action uses default paths for restoring caches.
default: ""
paths-macos:
description: |
- Overrides `paths`.
- Can have an effect only when the action runs on a `macOS` runner.
default: ""
paths-linux:
description: |
- Overrides `paths`.
- Can have an effect only when the action runs on a `Linux` runner.
default: ""
token:
description: The action uses it to communicate with GitHub API.
default: ${{ github.token }}
outputs:
primary-key:
description: |
- A string.
- The `primary-key`.
hit:
description: |
- A boolean value.
- `true` when `hit-primary-key` is `true` or `hit-first-match` is `true`.
- `false` otherwise.
hit-primary-key:
description: |
- A boolean value.
- `true` when there was a hit on the `primary-key`.
- `false` otherwise.
hit-first-match:
description: |
- A boolean value.
- `true` when there was a hit on a key matching `restore-prefixes-first-match`.
- `false` otherwise.
restored-key:
description: |
- A string.
- The key of a cache restored via the `primary-key` or via the `restore-prefixes-first-match`.
- An empty string otherwise.
restored-keys:
description: |
- A possibly empty array of strings (JSON).
- Keys of restored caches.
- Example: `["key1", "key2"]`.
runs:
using: "node20"
main: "../dist/restore-only/index.js"
branding:
icon: "archive"
color: "gray-dark"