diff --git a/.licenses/npm/@actions/http-client.dep.yml b/.licenses/npm/@actions/http-client.dep.yml index 53743c1..1bf161b 100644 Binary files a/.licenses/npm/@actions/http-client.dep.yml and b/.licenses/npm/@actions/http-client.dep.yml differ diff --git a/.licenses/npm/@azure/abort-controller.dep.yml b/.licenses/npm/@azure/abort-controller-1.1.0.dep.yml similarity index 100% rename from .licenses/npm/@azure/abort-controller.dep.yml rename to .licenses/npm/@azure/abort-controller-1.1.0.dep.yml diff --git a/.licenses/npm/@azure/abort-controller-2.1.2.dep.yml b/.licenses/npm/@azure/abort-controller-2.1.2.dep.yml new file mode 100644 index 0000000..934bd3b Binary files /dev/null and b/.licenses/npm/@azure/abort-controller-2.1.2.dep.yml differ diff --git a/.licenses/npm/@azure/core-auth.dep.yml b/.licenses/npm/@azure/core-auth.dep.yml index 830504b..3a038d0 100644 Binary files a/.licenses/npm/@azure/core-auth.dep.yml and b/.licenses/npm/@azure/core-auth.dep.yml differ diff --git a/.licenses/npm/@azure/core-http.dep.yml b/.licenses/npm/@azure/core-client.dep.yml similarity index 87% rename from .licenses/npm/@azure/core-http.dep.yml rename to .licenses/npm/@azure/core-client.dep.yml index 6a443e7..6d14129 100644 Binary files a/.licenses/npm/@azure/core-http.dep.yml and b/.licenses/npm/@azure/core-client.dep.yml differ diff --git a/.licenses/npm/@azure/core-http-compat.dep.yml b/.licenses/npm/@azure/core-http-compat.dep.yml new file mode 100644 index 0000000..a853c36 Binary files /dev/null and b/.licenses/npm/@azure/core-http-compat.dep.yml differ diff --git a/.licenses/npm/@azure/core-lro.dep.yml b/.licenses/npm/@azure/core-lro.dep.yml index 04f5f3a..46cbe6e 100644 Binary files a/.licenses/npm/@azure/core-lro.dep.yml and b/.licenses/npm/@azure/core-lro.dep.yml differ diff --git a/.licenses/npm/@azure/core-paging.dep.yml b/.licenses/npm/@azure/core-paging.dep.yml index dccc048..cc31605 100644 Binary files a/.licenses/npm/@azure/core-paging.dep.yml and b/.licenses/npm/@azure/core-paging.dep.yml differ diff --git a/.licenses/npm/@azure/core-rest-pipeline.dep.yml b/.licenses/npm/@azure/core-rest-pipeline.dep.yml new file mode 100644 index 0000000..a2475f1 Binary files /dev/null and b/.licenses/npm/@azure/core-rest-pipeline.dep.yml differ diff --git a/.licenses/npm/@azure/core-tracing.dep.yml b/.licenses/npm/@azure/core-tracing.dep.yml index a4649e8..92a75cb 100644 Binary files a/.licenses/npm/@azure/core-tracing.dep.yml and b/.licenses/npm/@azure/core-tracing.dep.yml differ diff --git a/.licenses/npm/@azure/core-util.dep.yml b/.licenses/npm/@azure/core-util.dep.yml index b1823e8..a14d595 100644 Binary files a/.licenses/npm/@azure/core-util.dep.yml and b/.licenses/npm/@azure/core-util.dep.yml differ diff --git a/.licenses/npm/@azure/core-xml.dep.yml b/.licenses/npm/@azure/core-xml.dep.yml new file mode 100644 index 0000000..f03dab9 Binary files /dev/null and b/.licenses/npm/@azure/core-xml.dep.yml differ diff --git a/.licenses/npm/@azure/logger.dep.yml b/.licenses/npm/@azure/logger.dep.yml index 971ba00..9eb8997 100644 Binary files a/.licenses/npm/@azure/logger.dep.yml and b/.licenses/npm/@azure/logger.dep.yml differ diff --git a/.licenses/npm/@azure/storage-blob.dep.yml b/.licenses/npm/@azure/storage-blob.dep.yml index f3ac473..30b2f92 100644 Binary files a/.licenses/npm/@azure/storage-blob.dep.yml and b/.licenses/npm/@azure/storage-blob.dep.yml differ diff --git a/.licenses/npm/@fastify/busboy.dep.yml b/.licenses/npm/@fastify/busboy.dep.yml new file mode 100644 index 0000000..817d644 Binary files /dev/null and b/.licenses/npm/@fastify/busboy.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/@types/node-fetch.dep.yml b/.licenses/npm/@types/node-fetch.dep.yml deleted file mode 100644 index a428e2c..0000000 Binary files a/.licenses/npm/@types/node-fetch.dep.yml and /dev/null differ diff --git a/.licenses/npm/@types/node.dep.yml b/.licenses/npm/@types/node.dep.yml deleted file mode 100644 index 65dc483..0000000 Binary files a/.licenses/npm/@types/node.dep.yml and /dev/null differ diff --git a/.licenses/npm/@types/tunnel.dep.yml b/.licenses/npm/@types/tunnel.dep.yml deleted file mode 100644 index b3636b0..0000000 Binary files a/.licenses/npm/@types/tunnel.dep.yml and /dev/null 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-7.1.3.dep.yml b/.licenses/npm/agent-base-7.1.3.dep.yml new file mode 100644 index 0000000..95054cd Binary files /dev/null and b/.licenses/npm/agent-base-7.1.3.dep.yml differ diff --git a/.licenses/npm/@opentelemetry/api.dep.yml b/.licenses/npm/before-after-hook.dep.yml similarity index 93% rename from .licenses/npm/@opentelemetry/api.dep.yml rename to .licenses/npm/before-after-hook.dep.yml index 8dd8991..c147501 100644 Binary files a/.licenses/npm/@opentelemetry/api.dep.yml and b/.licenses/npm/before-after-hook.dep.yml differ diff --git a/.licenses/npm/debug.dep.yml b/.licenses/npm/debug.dep.yml new file mode 100644 index 0000000..6b83236 Binary files /dev/null and b/.licenses/npm/debug.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 new file mode 100644 index 0000000..c026e3c Binary files /dev/null and b/.licenses/npm/fast-xml-parser.dep.yml differ diff --git a/.licenses/npm/form-data-2.5.1.dep.yml b/.licenses/npm/form-data-2.5.1.dep.yml deleted file mode 100644 index 000f222..0000000 Binary files a/.licenses/npm/form-data-2.5.1.dep.yml and /dev/null differ diff --git a/.licenses/npm/form-data-4.0.0.dep.yml b/.licenses/npm/form-data-4.0.0.dep.yml deleted file mode 100644 index ced7212..0000000 Binary files a/.licenses/npm/form-data-4.0.0.dep.yml and /dev/null differ diff --git a/.licenses/npm/form-data-3.0.1.dep.yml b/.licenses/npm/form-data.dep.yml similarity index 95% rename from .licenses/npm/form-data-3.0.1.dep.yml rename to .licenses/npm/form-data.dep.yml index 1173367..2d0e791 100644 Binary files a/.licenses/npm/form-data-3.0.1.dep.yml and b/.licenses/npm/form-data.dep.yml differ diff --git a/.licenses/npm/glob.dep.yml b/.licenses/npm/glob.dep.yml index 51f01c3..257b41b 100644 Binary files a/.licenses/npm/glob.dep.yml and b/.licenses/npm/glob.dep.yml differ diff --git a/.licenses/npm/process.dep.yml b/.licenses/npm/http-proxy-agent.dep.yml similarity index 85% rename from .licenses/npm/process.dep.yml rename to .licenses/npm/http-proxy-agent.dep.yml index 2bf5059..bcd2757 100644 Binary files a/.licenses/npm/process.dep.yml and b/.licenses/npm/http-proxy-agent.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-7.0.6.dep.yml b/.licenses/npm/https-proxy-agent-7.0.6.dep.yml new file mode 100644 index 0000000..7b6e176 Binary files /dev/null and b/.licenses/npm/https-proxy-agent-7.0.6.dep.yml differ 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/mime-db.dep.yml b/.licenses/npm/mime-db.dep.yml index 28fe4bb..6605669 100644 Binary files a/.licenses/npm/mime-db.dep.yml and b/.licenses/npm/mime-db.dep.yml differ diff --git a/.licenses/npm/mime-types.dep.yml b/.licenses/npm/mime-types.dep.yml index f7d509c..832d205 100644 Binary files a/.licenses/npm/mime-types.dep.yml and b/.licenses/npm/mime-types.dep.yml differ diff --git a/.licenses/npm/ms.dep.yml b/.licenses/npm/ms.dep.yml new file mode 100644 index 0000000..5a303e4 Binary files /dev/null and b/.licenses/npm/ms.dep.yml differ diff --git a/.licenses/npm/node-fetch.dep.yml b/.licenses/npm/node-fetch.dep.yml index b49a78a..ec9a760 100644 Binary files a/.licenses/npm/node-fetch.dep.yml and b/.licenses/npm/node-fetch.dep.yml differ diff --git a/.licenses/npm/prettier.dep.yml b/.licenses/npm/prettier.dep.yml index 78b45ee..c2021dd 100644 Binary files a/.licenses/npm/prettier.dep.yml and b/.licenses/npm/prettier.dep.yml differ diff --git a/.licenses/npm/safe-buffer.dep.yml b/.licenses/npm/safe-buffer.dep.yml new file mode 100644 index 0000000..a6499e3 Binary files /dev/null and b/.licenses/npm/safe-buffer.dep.yml differ diff --git a/.licenses/npm/sax.dep.yml b/.licenses/npm/sax.dep.yml index e964a17..e0b0cc0 100644 Binary files a/.licenses/npm/sax.dep.yml and b/.licenses/npm/sax.dep.yml differ diff --git a/.licenses/npm/strnum.dep.yml b/.licenses/npm/strnum.dep.yml new file mode 100644 index 0000000..90b6b4a Binary files /dev/null and b/.licenses/npm/strnum.dep.yml differ diff --git a/.licenses/npm/tslib-2.3.1.dep.yml b/.licenses/npm/tslib-2.3.1.dep.yml deleted file mode 100644 index a6d5be4..0000000 Binary files a/.licenses/npm/tslib-2.3.1.dep.yml and /dev/null differ diff --git a/.licenses/npm/tslib-2.5.0.dep.yml b/.licenses/npm/tslib-2.5.0.dep.yml deleted file mode 100644 index e37d1d7..0000000 Binary files a/.licenses/npm/tslib-2.5.0.dep.yml and /dev/null differ diff --git a/.licenses/npm/undici.dep.yml b/.licenses/npm/undici.dep.yml new file mode 100644 index 0000000..961089c Binary files /dev/null and b/.licenses/npm/undici.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/README.md b/README.md index 3f07f15..1328de0 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,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. @@ -76,10 +77,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 5fd0566..6965e06 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 dc45c38..ec3a301 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 5708986..01f4232 100644 --- a/tips-and-workarounds.md +++ b/tips-and-workarounds.md @@ -21,7 +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. + ## Use cache across feature branches Reusing cache across feature branches is not allowed today to provide cache [isolation](https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache). However if both feature branches are from the default branch, a good way to achieve this is to ensure that the default branch has a cache. This cache will then be consumable by both feature branches.