diff --git a/.licenses/npm/@azure/storage-common.dep.yml b/.licenses/npm/@azure/storage-common.dep.yml index daa7f94..5f0a0ed 100644 Binary files a/.licenses/npm/@azure/storage-common.dep.yml and b/.licenses/npm/@azure/storage-common.dep.yml differ diff --git a/.licenses/npm/@octokit/action.dep.yml b/.licenses/npm/@octokit/action.dep.yml new file mode 100644 index 0000000..ebd1c35 Binary files /dev/null and b/.licenses/npm/@octokit/action.dep.yml differ diff --git a/.licenses/npm/@octokit/auth-action.dep.yml b/.licenses/npm/@octokit/auth-action.dep.yml new file mode 100644 index 0000000..24cc177 Binary files /dev/null and b/.licenses/npm/@octokit/auth-action.dep.yml differ diff --git a/.licenses/npm/@octokit/auth-token.dep.yml b/.licenses/npm/@octokit/auth-token.dep.yml new file mode 100644 index 0000000..61a7442 Binary files /dev/null and b/.licenses/npm/@octokit/auth-token.dep.yml differ diff --git a/.licenses/npm/@octokit/core.dep.yml b/.licenses/npm/@octokit/core.dep.yml new file mode 100644 index 0000000..f28aa30 Binary files /dev/null and b/.licenses/npm/@octokit/core.dep.yml differ diff --git a/.licenses/npm/@octokit/endpoint.dep.yml b/.licenses/npm/@octokit/endpoint.dep.yml new file mode 100644 index 0000000..10d5163 Binary files /dev/null and b/.licenses/npm/@octokit/endpoint.dep.yml differ diff --git a/.licenses/npm/@octokit/graphql.dep.yml b/.licenses/npm/@octokit/graphql.dep.yml new file mode 100644 index 0000000..94f4800 Binary files /dev/null and b/.licenses/npm/@octokit/graphql.dep.yml differ diff --git a/.licenses/npm/@octokit/openapi-types-14.0.0.dep.yml b/.licenses/npm/@octokit/openapi-types-14.0.0.dep.yml new file mode 100644 index 0000000..4910377 Binary files /dev/null and b/.licenses/npm/@octokit/openapi-types-14.0.0.dep.yml differ diff --git a/.licenses/npm/@octokit/openapi-types-18.1.1.dep.yml b/.licenses/npm/@octokit/openapi-types-18.1.1.dep.yml new file mode 100644 index 0000000..159d730 Binary files /dev/null and b/.licenses/npm/@octokit/openapi-types-18.1.1.dep.yml differ diff --git a/.licenses/npm/@octokit/plugin-paginate-rest.dep.yml b/.licenses/npm/@octokit/plugin-paginate-rest.dep.yml new file mode 100644 index 0000000..784d283 Binary files /dev/null and b/.licenses/npm/@octokit/plugin-paginate-rest.dep.yml differ diff --git a/.licenses/npm/@octokit/plugin-rest-endpoint-methods.dep.yml b/.licenses/npm/@octokit/plugin-rest-endpoint-methods.dep.yml new file mode 100644 index 0000000..d838fcd Binary files /dev/null and b/.licenses/npm/@octokit/plugin-rest-endpoint-methods.dep.yml differ diff --git a/.licenses/npm/@octokit/request-error.dep.yml b/.licenses/npm/@octokit/request-error.dep.yml new file mode 100644 index 0000000..60c5ca5 Binary files /dev/null and b/.licenses/npm/@octokit/request-error.dep.yml differ diff --git a/.licenses/npm/@octokit/request.dep.yml b/.licenses/npm/@octokit/request.dep.yml new file mode 100644 index 0000000..b8bea5d Binary files /dev/null and b/.licenses/npm/@octokit/request.dep.yml differ diff --git a/.licenses/npm/@octokit/types-8.2.1.dep.yml b/.licenses/npm/@octokit/types-8.2.1.dep.yml new file mode 100644 index 0000000..da30a40 Binary files /dev/null and b/.licenses/npm/@octokit/types-8.2.1.dep.yml differ diff --git a/.licenses/npm/@octokit/types-9.3.2.dep.yml b/.licenses/npm/@octokit/types-9.3.2.dep.yml new file mode 100644 index 0000000..59743bf Binary files /dev/null and b/.licenses/npm/@octokit/types-9.3.2.dep.yml differ diff --git a/.licenses/npm/agent-base-6.0.2.dep.yml b/.licenses/npm/agent-base-6.0.2.dep.yml new file mode 100644 index 0000000..6642d66 Binary files /dev/null and b/.licenses/npm/agent-base-6.0.2.dep.yml differ diff --git a/.licenses/npm/agent-base.dep.yml b/.licenses/npm/agent-base-7.1.4.dep.yml similarity index 100% rename from .licenses/npm/agent-base.dep.yml rename to .licenses/npm/agent-base-7.1.4.dep.yml diff --git a/.licenses/npm/before-after-hook.dep.yml b/.licenses/npm/before-after-hook.dep.yml new file mode 100644 index 0000000..a1c6b84 Binary files /dev/null and b/.licenses/npm/before-after-hook.dep.yml differ diff --git a/.licenses/npm/deprecation.dep.yml b/.licenses/npm/deprecation.dep.yml new file mode 100644 index 0000000..683fdfc Binary files /dev/null and b/.licenses/npm/deprecation.dep.yml differ diff --git a/.licenses/npm/fast-xml-parser.dep.yml b/.licenses/npm/fast-xml-parser.dep.yml index 77eec1e..e183222 100644 Binary files a/.licenses/npm/fast-xml-parser.dep.yml and b/.licenses/npm/fast-xml-parser.dep.yml differ diff --git a/.licenses/npm/https-proxy-agent-5.0.1.dep.yml b/.licenses/npm/https-proxy-agent-5.0.1.dep.yml new file mode 100644 index 0000000..ac2983a Binary files /dev/null and b/.licenses/npm/https-proxy-agent-5.0.1.dep.yml differ diff --git a/.licenses/npm/https-proxy-agent.dep.yml b/.licenses/npm/https-proxy-agent-7.0.6.dep.yml similarity index 100% rename from .licenses/npm/https-proxy-agent.dep.yml rename to .licenses/npm/https-proxy-agent-7.0.6.dep.yml diff --git a/.licenses/npm/is-plain-object.dep.yml b/.licenses/npm/is-plain-object.dep.yml new file mode 100644 index 0000000..671ba20 Binary files /dev/null and b/.licenses/npm/is-plain-object.dep.yml differ diff --git a/.licenses/npm/ms.dep.yml b/.licenses/npm/ms.dep.yml index 5a303e4..515a6fc 100644 Binary files a/.licenses/npm/ms.dep.yml and b/.licenses/npm/ms.dep.yml differ diff --git a/.licenses/npm/node-fetch.dep.yml b/.licenses/npm/node-fetch.dep.yml new file mode 100644 index 0000000..ec9a760 Binary files /dev/null and b/.licenses/npm/node-fetch.dep.yml differ diff --git a/.licenses/npm/once.dep.yml b/.licenses/npm/once.dep.yml new file mode 100644 index 0000000..af362ac Binary files /dev/null and b/.licenses/npm/once.dep.yml differ diff --git a/.licenses/npm/tr46.dep.yml b/.licenses/npm/tr46.dep.yml new file mode 100644 index 0000000..3bacc6e Binary files /dev/null and b/.licenses/npm/tr46.dep.yml differ diff --git a/.licenses/npm/universal-user-agent.dep.yml b/.licenses/npm/universal-user-agent.dep.yml new file mode 100644 index 0000000..c07307b Binary files /dev/null and b/.licenses/npm/universal-user-agent.dep.yml differ diff --git a/.licenses/npm/webidl-conversions.dep.yml b/.licenses/npm/webidl-conversions.dep.yml new file mode 100644 index 0000000..8c89571 Binary files /dev/null and b/.licenses/npm/webidl-conversions.dep.yml differ diff --git a/.licenses/npm/whatwg-url.dep.yml b/.licenses/npm/whatwg-url.dep.yml new file mode 100644 index 0000000..73a6988 Binary files /dev/null and b/.licenses/npm/whatwg-url.dep.yml differ diff --git a/.licenses/npm/wrappy.dep.yml b/.licenses/npm/wrappy.dep.yml new file mode 100644 index 0000000..2a532ec Binary files /dev/null and b/.licenses/npm/wrappy.dep.yml differ diff --git a/README.md b/README.md index 6cb71e7..b52e35b 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,7 @@ Read more about the change & access the migration guide: [reference to the annou ### v3 +* Added a workaround to allow updating/refreshing existing caches, via the `refresh-cache` option and requiring a valid Github API token. * Integrated with the new cache service (v2) APIs. * Added support for caching in GHES 3.5+. * Fixed download issue for files > 2GB during restore. @@ -90,10 +91,12 @@ If you are using a `self-hosted` Windows runner, `GNU tar` and `zstd` are requir * `enableCrossOsArchive` - An optional boolean when enabled, allows Windows runners to save or restore caches that can be restored or saved respectively on other platforms. Default: `false` * `fail-on-cache-miss` - Fail the workflow if cache entry is not found. Default: `false` * `lookup-only` - If true, only checks if cache entry exists and skips download. Does not change save cache behavior. Default: `false` +* `refresh-cache` - An optional boolean, when enabled it will result in a matched key being deleted after being restored, allowing it to be reused with refreshed/updated content. Default: false #### Environment Variables * `SEGMENT_DOWNLOAD_TIMEOUT_MINS` - Segment download timeout (in minutes, default `10`) to abort download of the segment if not completed in the defined number of minutes. [Read more](https://github.com/actions/cache/blob/main/tips-and-workarounds.md#cache-segment-restore-timeout) +* `GITHUB_TOKEN` - A Github API token, required for authenticating to the API when the `refresh-cache` option is enabled. ### Outputs diff --git a/action.yml b/action.yml index 18dd3ea..0ce1e60 100644 --- a/action.yml +++ b/action.yml @@ -35,7 +35,7 @@ inputs: A separate `actions/cache/restore` step should be used instead. See https://github.com/actions/cache/tree/main/save#always-save-cache for more details. refresh-cache: - description: 'Whether to try and refresh existing caches (requires GITHUB_TOKEN to be present in env)' + description: 'An optional boolean, when enabled it will result in a matched key being deleted after being restored, allowing it to be reused with refreshed/updated content. Default: false' required: false default: 'false' outputs: diff --git a/save/README.md b/save/README.md index d5352fd..24ad442 100644 --- a/save/README.md +++ b/save/README.md @@ -9,6 +9,11 @@ The save action saves a cache. It works similarly to the `cache` action except t * `key` - An explicit key for a cache entry. See [creating a cache key](../README.md#creating-a-cache-key). * `path` - A list of files, directories, and wildcard patterns to cache. See [`@actions/glob`](https://github.com/actions/toolkit/tree/main/packages/glob) for supported patterns. * `upload-chunk-size` - The chunk size used to split up large files during upload, in bytes +* `refresh-cache` - An optional boolean, when enabled it will result in a matched key being deleted after being restored, allowing it to be reused with refreshed/updated content. Default: false + +#### Environment Variables + +* `GITHUB_TOKEN` - A Github API token, required for authenticating to the API when the `refresh-cache` option is enabled. ### Outputs diff --git a/tips-and-workarounds.md b/tips-and-workarounds.md index a0efd34..72fb163 100644 --- a/tips-and-workarounds.md +++ b/tips-and-workarounds.md @@ -21,6 +21,8 @@ A cache today is immutable and cannot be updated. But some use cases require the ``` Please note that this will create a new cache on every run and hence will consume the cache [quota](./README.md#cache-limits). + As a way to get around this limitation, the `refresh-cache` option exists. The way this works is, after matching a key and restoring a cache, it makes a request directly to the Github API and deletes the contents of that cache entry, then leaving said key free to be updated. + - Note, however, that this requires the `actions: write` permission on your workflow. ## Use cache across feature branches