mirror of
https://github.com/jdx/mise-action.git
synced 2026-07-03 09:59:32 +00:00
chore(deps): update dependency @actions/cache to v6.1.0 (#532)
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [@actions/cache](https://redirect.github.com/actions/toolkit/tree/main/packages/cache) ([source](https://redirect.github.com/actions/toolkit/tree/HEAD/packages/cache)) | [`6.0.1` → `6.1.0`](https://renovatebot.com/diffs/npm/@actions%2fcache/6.0.1/6.1.0) |  |  | --- ### Release Notes <details> <summary>actions/toolkit (@​actions/cache)</summary> ### [`v6.1.0`](https://redirect.github.com/actions/toolkit/blob/HEAD/packages/cache/RELEASES.md#610) - Handle cache write error due to read-only token: detect the `cache write denied:` prefix on cache reservation failures and surface it as a `core.warning` (without failing the run). </details> --- ### Configuration 📅 **Schedule**: (in timezone America/Chicago) - Branch creation - Only on Friday (`* * * * 5`) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/jdx/mise-action). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNDIuMiIsInVwZGF0ZWRJblZlciI6IjQzLjI0Mi4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Jeff Dickey <216188+jdx@users.noreply.github.com>
This commit is contained in:
parent
bac1315236
commit
e4e204e23e
4 changed files with 69 additions and 9 deletions
68
dist/index.js
generated
vendored
68
dist/index.js
generated
vendored
|
|
@ -72709,7 +72709,7 @@ function getCacheServiceURL() {
|
|||
}
|
||||
}
|
||||
|
||||
var version = "6.0.1";
|
||||
var version = "6.1.0";
|
||||
var require$$0 = {
|
||||
version: version};
|
||||
|
||||
|
|
@ -76959,6 +76959,35 @@ class ReserveCacheError extends Error {
|
|||
Object.setPrototypeOf(this, ReserveCacheError.prototype);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Stable prefix the receiver writes into the cache reservation response when
|
||||
* the issuer downgraded the cache token to read-only (for example, because
|
||||
* the run was triggered by an untrusted event). saveCacheV1 / saveCacheV2
|
||||
* dispatch on this prefix to re-classify the failure as a
|
||||
* CacheWriteDeniedError so consumers (and the outer catch arm) can
|
||||
* distinguish a policy denial from other reservation failures.
|
||||
*/
|
||||
const CACHE_WRITE_DENIED_PREFIX = 'cache write denied:';
|
||||
/**
|
||||
* Raised when the cache backend refuses to reserve a writable cache entry
|
||||
* because the JWT issued for this run was scoped read-only (for example, the
|
||||
* run was triggered by an event the repository administrator classified as
|
||||
* untrusted). The receiver-supplied detail message always begins with
|
||||
* `cache write denied:` (the full error message includes additional context
|
||||
* like the cache key).
|
||||
*
|
||||
* Extends ReserveCacheError for source-compatibility: existing
|
||||
* `instanceof ReserveCacheError` checks and `typedError.name ===
|
||||
* ReserveCacheError.name` paths keep working, while consumers that want to
|
||||
* distinguish the policy case can match on this subclass.
|
||||
*/
|
||||
class CacheWriteDeniedError extends ReserveCacheError {
|
||||
constructor(message) {
|
||||
super(message);
|
||||
this.name = 'CacheWriteDeniedError';
|
||||
Object.setPrototypeOf(this, CacheWriteDeniedError.prototype);
|
||||
}
|
||||
}
|
||||
class FinalizeCacheError extends Error {
|
||||
constructor(message) {
|
||||
super(message);
|
||||
|
|
@ -77213,7 +77242,7 @@ function saveCache$1(paths_1, key_1, options_1) {
|
|||
*/
|
||||
function saveCacheV1(paths_1, key_1, options_1) {
|
||||
return __awaiter$3(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) {
|
||||
var _a, _b, _c, _d, _e;
|
||||
var _a, _b, _c, _d, _e, _f;
|
||||
const compressionMethod = yield getCompressionMethod();
|
||||
let cacheId = -1;
|
||||
const cachePaths = yield resolvePaths(paths);
|
||||
|
|
@ -77250,7 +77279,17 @@ function saveCacheV1(paths_1, key_1, options_1) {
|
|||
throw new Error((_d = (_c = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _c === void 0 ? void 0 : _c.message) !== null && _d !== void 0 ? _d : `Cache size of ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B) is over the data cap limit, not saving cache.`);
|
||||
}
|
||||
else {
|
||||
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message}`);
|
||||
// Inspect the receiver's error message before deciding which error to
|
||||
// throw. A message starting with the stable `cache write denied:`
|
||||
// prefix indicates the issuer downgraded the token to read-only
|
||||
// (policy denial), not a contention case, so we surface it as a
|
||||
// CacheWriteDeniedError which the outer catch arm logs at warning
|
||||
// level.
|
||||
const detailMessage = (_e = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _e === void 0 ? void 0 : _e.message;
|
||||
if (detailMessage === null || detailMessage === void 0 ? void 0 : detailMessage.startsWith(CACHE_WRITE_DENIED_PREFIX)) {
|
||||
throw new CacheWriteDeniedError(`Unable to reserve cache with key ${key}. More details: ${detailMessage}`);
|
||||
}
|
||||
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache. More details: ${(_f = reserveCacheResponse === null || reserveCacheResponse === void 0 ? void 0 : reserveCacheResponse.error) === null || _f === void 0 ? void 0 : _f.message}`);
|
||||
}
|
||||
debug(`Saving Cache (ID: ${cacheId})`);
|
||||
yield saveCache$2(cacheId, archivePath, '', options);
|
||||
|
|
@ -77260,6 +77299,12 @@ function saveCacheV1(paths_1, key_1, options_1) {
|
|||
if (typedError.name === ValidationError.name) {
|
||||
throw error$1;
|
||||
}
|
||||
else if (typedError.name === CacheWriteDeniedError.name) {
|
||||
// Cache write was denied by policy (read-only token). Surface to the
|
||||
// customer at warning level so it is visible in the workflow log
|
||||
// without failing the run.
|
||||
warning(`Failed to save: ${typedError.message}`);
|
||||
}
|
||||
else if (typedError.name === ReserveCacheError.name) {
|
||||
info(`Failed to save: ${typedError.message}`);
|
||||
}
|
||||
|
|
@ -77298,6 +77343,7 @@ function saveCacheV1(paths_1, key_1, options_1) {
|
|||
*/
|
||||
function saveCacheV2(paths_1, key_1, options_1) {
|
||||
return __awaiter$3(this, arguments, void 0, function* (paths, key, options, enableCrossOsArchive = false) {
|
||||
var _a;
|
||||
// Override UploadOptions to force the use of Azure
|
||||
// ...options goes first because we want to override the default values
|
||||
// set in UploadOptions with these specific figures
|
||||
|
|
@ -77333,7 +77379,11 @@ function saveCacheV2(paths_1, key_1, options_1) {
|
|||
try {
|
||||
const response = yield twirpClient.CreateCacheEntry(request);
|
||||
if (!response.ok) {
|
||||
if (response.message) {
|
||||
// Skip the redundant inner warning when the receiver signalled a
|
||||
// policy denial: the outer catch arm below will log a single
|
||||
// customer-facing warning.
|
||||
if (response.message &&
|
||||
!response.message.startsWith(CACHE_WRITE_DENIED_PREFIX)) {
|
||||
warning(`Cache reservation failed: ${response.message}`);
|
||||
}
|
||||
throw new Error(response.message || 'Response was not ok');
|
||||
|
|
@ -77342,6 +77392,10 @@ function saveCacheV2(paths_1, key_1, options_1) {
|
|||
}
|
||||
catch (error) {
|
||||
debug(`Failed to reserve cache: ${error}`);
|
||||
const errorMessage = (_a = error === null || error === void 0 ? void 0 : error.message) !== null && _a !== void 0 ? _a : '';
|
||||
if (errorMessage.startsWith(CACHE_WRITE_DENIED_PREFIX)) {
|
||||
throw new CacheWriteDeniedError(`Unable to reserve cache with key ${key}. More details: ${errorMessage}`);
|
||||
}
|
||||
throw new ReserveCacheError(`Unable to reserve cache with key ${key}, another job may be creating this cache.`);
|
||||
}
|
||||
debug(`Attempting to upload cache located at: ${archivePath}`);
|
||||
|
|
@ -77366,6 +77420,12 @@ function saveCacheV2(paths_1, key_1, options_1) {
|
|||
if (typedError.name === ValidationError.name) {
|
||||
throw error$1;
|
||||
}
|
||||
else if (typedError.name === CacheWriteDeniedError.name) {
|
||||
// Cache write was denied by policy (read-only token). Surface to the
|
||||
// customer at warning level so it is visible in the workflow log
|
||||
// without failing the run.
|
||||
warning(`Failed to save: ${typedError.message}`);
|
||||
}
|
||||
else if (typedError.name === ReserveCacheError.name) {
|
||||
info(`Failed to save: ${typedError.message}`);
|
||||
}
|
||||
|
|
|
|||
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/licenses.txt
generated
vendored
2
dist/licenses.txt
generated
vendored
|
|
@ -355,7 +355,7 @@ IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|||
---
|
||||
|
||||
Name: @actions/cache
|
||||
Version: 6.0.1
|
||||
Version: 6.1.0
|
||||
License: MIT
|
||||
Private: false
|
||||
Description: Actions cache lib
|
||||
|
|
|
|||
6
package-lock.json
generated
6
package-lock.json
generated
|
|
@ -40,9 +40,9 @@
|
|||
}
|
||||
},
|
||||
"node_modules/@actions/cache": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-6.0.1.tgz",
|
||||
"integrity": "sha512-kcM23yPzDQEME05ZFV/bRzsHS9yDzCe97F7guF9+c/jJwE9ns+gFQt3MmnRXOHh1DsnlNuKcIwXYdnt4kHLGqg==",
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/@actions/cache/-/cache-6.1.0.tgz",
|
||||
"integrity": "sha512-LVqybSbzhBp2uAETOQ3HnVjXA4AcjavgMH+LCr+cjgO+PZfciv/1QAgoW+esXBaAhvDid+vXeV70GGJpAh4V5Q==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@actions/core": "^3.0.1",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue