Skip to content

Commit

Permalink
fix: use secrets.github_token
Browse files Browse the repository at this point in the history
  • Loading branch information
deemp committed Dec 11, 2023
1 parent f2bb20e commit 20678a1
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 12 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ jobs:
purge-created: 0
purge-prefixes: similar-cache-${{ matrix.os }}-individual-${{ matrix.id }}-

token: ${{ github.token }}

# Merge similar individual `id` caches
# Purge individual caches and old `common` caches
# Save new `common` caches
Expand Down
2 changes: 1 addition & 1 deletion README.md

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions action.nix
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,12 @@ in
description: |
- When a number, the action uses it as the chunk size (in bytes) to split up large files during upload.
- Otherwise, the action uses the default value `33554432` (32MB).
default: ""
default: ""''
else ""}
token:
description: The action uses it to communicate with GitHub API.
default: ''${{ github.token }}''
else ""
}
default: ''${{ secrets.GITHUB_TOKEN }}
${
if target == "cache" || target == "restore" then
''
Expand Down
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ inputs:

token:
description: The action uses it to communicate with GitHub API.
default: ${{ github.token }}
default: ${{ secrets.GITHUB_TOKEN }}
outputs:
primary-key:
description: |
Expand Down
2 changes: 1 addition & 1 deletion restore/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The restore action restores a cache. It works similarly to the `cache` action ex

### Inputs

<table><tr><th>name</th><th>description</th><th>default</th><th>required</th></tr><tr><td><div><p><code>primary-key</code></p></div></td><td><div><ul><li>When a non-empty string, the action uses this key for restoring a cache.</li><li>Otherwise, the action fails.</li></ul></div></td><td><div/></td><td><div><p><code>true</code></p></div></td></tr><tr><td><div><p><code>restore-prefixes-first-match</code></p></div></td><td><div><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></div></td><td><div><p><code>''</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>restore-prefixes-all-matches</code></p></div></td><td><div><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>Otherwise, this input has no effect.</li></ul></div></td><td><div><p><code>''</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>skip-restore-on-hit-primary-key</code></p></div></td><td><div><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, this input has no effect.</li></ul></div></td><td><div><p><code>false</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>fail-on</code></p></div></td><td><div><ul><li>Input form: <code>&lt;key type&gt;.&lt;result&gt;</code>.</li><li><code>&lt;key type&gt;</code> options: <code>primary</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:</li><li>Input: <code>primary.not-restored</code>.</li><li>Event: a cache could not be restored via the <code>primary-key</code>.</li></ul></div></td><td><div/></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>nix</code></p></div></td><td><div><ul><li>When <code>true</code>, the action can do Nix-specific things.</li><li>Otherwise, the action doesn't do them.</li></ul></div></td><td><div><p><code>true</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>save</code></p></div></td><td><div><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></div></td><td><div><p><code>true</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>paths</code></p></div></td><td><div><ul><li>When <code>nix: true</code>, uses <code>["/nix", "~/.cache/nix", "~root/.cache/nix"]</code> as default paths. Otherwise, uses an empty list as default paths.</li><li>When a newline-separated non-empty list of non-empty path patterns (see <a href="https://github.com/actions/toolkit/tree/main/packages/glob"><code>@actions/glob</code></a> for supported patterns), the action appends it to default paths and uses the resulting list for restoring caches.</li><li>Otherwise, the action uses default paths for restoring caches.</li></ul></div></td><td><div><p><code>''</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>paths-macos</code></p></div></td><td><div><ul><li>Overrides <code>paths</code>.</li><li>Can have an effect only when on a <code>macOS</code> runner.</li><li>When <code>nix: true</code>, uses <code>["/nix", "~/.cache/nix", "~root/.cache/nix"]</code> as default paths. Otherwise, uses an empty list as default paths.</li><li>When a newline-separated non-empty list of non-empty path patterns (see <a href="https://github.com/actions/toolkit/tree/main/packages/glob"><code>@actions/glob</code></a> for supported patterns), the action appends it to default paths and uses the resulting list for restoring caches.</li><li>Otherwise, the action uses default paths for restoring caches.</li></ul></div></td><td><div><p><code>''</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>paths-linux</code></p></div></td><td><div><ul><li>Overrides <code>paths</code>.</li><li>Can have an effect only when on a <code>Linux</code> runner.</li><li>When <code>nix: true</code>, uses <code>["/nix", "~/.cache/nix", "~root/.cache/nix"]</code> as default paths. Otherwise, uses an empty list as default paths.</li><li>When a newline-separated non-empty list of non-empty path patterns (see <a href="https://github.com/actions/toolkit/tree/main/packages/glob"><code>@actions/glob</code></a> for supported patterns), the action appends it to default paths and uses the resulting list for restoring caches.</li><li>Otherwise, the action uses default paths for restoring caches.</li></ul></div></td><td><div><p><code>''</code></p></div></td><td><div><p><code>false</code></p></div></td></tr></table>
<table><tr><th>name</th><th>description</th><th>default</th><th>required</th></tr><tr><td><div><p><code>primary-key</code></p></div></td><td><div><ul><li>When a non-empty string, the action uses this key for restoring a cache.</li><li>Otherwise, the action fails.</li></ul></div></td><td><div/></td><td><div><p><code>true</code></p></div></td></tr><tr><td><div><p><code>restore-prefixes-first-match</code></p></div></td><td><div><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></div></td><td><div><p><code>''</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>restore-prefixes-all-matches</code></p></div></td><td><div><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>Otherwise, this input has no effect.</li></ul></div></td><td><div><p><code>''</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>skip-restore-on-hit-primary-key</code></p></div></td><td><div><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, this input has no effect.</li></ul></div></td><td><div><p><code>false</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>fail-on</code></p></div></td><td><div><ul><li>Input form: <code>&lt;key type&gt;.&lt;result&gt;</code>.</li><li><code>&lt;key type&gt;</code> options: <code>primary</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:</li><li>Input: <code>primary.not-restored</code>.</li><li>Event: a cache could not be restored via the <code>primary-key</code>.</li></ul></div></td><td><div/></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>nix</code></p></div></td><td><div><ul><li>When <code>true</code>, the action can do Nix-specific things.</li><li>Otherwise, the action doesn't do them.</li></ul></div></td><td><div><p><code>true</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>save</code></p></div></td><td><div><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></div></td><td><div><p><code>true</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>paths</code></p></div></td><td><div><ul><li>When <code>nix: true</code>, uses <code>["/nix", "~/.cache/nix", "~root/.cache/nix"]</code> as default paths. Otherwise, uses an empty list as default paths.</li><li>When a newline-separated non-empty list of non-empty path patterns (see <a href="https://github.com/actions/toolkit/tree/main/packages/glob"><code>@actions/glob</code></a> for supported patterns), the action appends it to default paths and uses the resulting list for restoring caches.</li><li>Otherwise, the action uses default paths for restoring caches.</li></ul></div></td><td><div><p><code>''</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>paths-macos</code></p></div></td><td><div><ul><li>Overrides <code>paths</code>.</li><li>Can have an effect only when on a <code>macOS</code> runner.</li><li>When <code>nix: true</code>, uses <code>["/nix", "~/.cache/nix", "~root/.cache/nix"]</code> as default paths. Otherwise, uses an empty list as default paths.</li><li>When a newline-separated non-empty list of non-empty path patterns (see <a href="https://github.com/actions/toolkit/tree/main/packages/glob"><code>@actions/glob</code></a> for supported patterns), the action appends it to default paths and uses the resulting list for restoring caches.</li><li>Otherwise, the action uses default paths for restoring caches.</li></ul></div></td><td><div><p><code>''</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>paths-linux</code></p></div></td><td><div><ul><li>Overrides <code>paths</code>.</li><li>Can have an effect only when on a <code>Linux</code> runner.</li><li>When <code>nix: true</code>, uses <code>["/nix", "~/.cache/nix", "~root/.cache/nix"]</code> as default paths. Otherwise, uses an empty list as default paths.</li><li>When a newline-separated non-empty list of non-empty path patterns (see <a href="https://github.com/actions/toolkit/tree/main/packages/glob"><code>@actions/glob</code></a> for supported patterns), the action appends it to default paths and uses the resulting list for restoring caches.</li><li>Otherwise, the action uses default paths for restoring caches.</li></ul></div></td><td><div><p><code>''</code></p></div></td><td><div><p><code>false</code></p></div></td></tr><tr><td><div><p><code>token</code></p></div></td><td><div><p>The action uses it to communicate with GitHub API.</p></div></td><td><div><p><code>${{ secrets.GITHUB_TOKEN }}</code></p></div></td><td><div><p><code>false</code></p></div></td></tr></table>

### Outputs

Expand Down
4 changes: 4 additions & 0 deletions restore/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ inputs:
default: ""



token:
description: The action uses it to communicate with GitHub API.
default: ${{ secrets.GITHUB_TOKEN }}
outputs:
primary-key:
description: |
Expand Down
Loading

0 comments on commit 20678a1

Please sign in to comment.