1
0
mirror of https://github.com/actions/cache.git synced 2025-08-12 05:20:12 +08:00
This commit is contained in:
Salman Chishti 2025-08-06 10:30:21 +00:00 committed by GitHub
commit fd35c927d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
32 changed files with 5531 additions and 9133 deletions

View File

@ -16,4 +16,4 @@ jobs:
name: Check dist/
uses: actions/reusable-workflows/.github/workflows/check-dist.yml@main
with:
node-version: "20.x"
node-version: "24.x"

View File

@ -21,10 +21,10 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js 20.x
- name: Setup Node.js 24.x
uses: actions/setup-node@v4
with:
node-version: 20.x
node-version: 24.x
cache: npm
- run: npm ci
- name: Prettier Format Check

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -38,7 +38,7 @@ outputs:
cache-hit:
description: 'A boolean value to indicate an exact match was found for the primary key'
runs:
using: 'node20'
using: 'node24'
main: 'dist/restore/index.js'
post: 'dist/save/index.js'
post-if: "success()"

View File

@ -64912,24 +64912,24 @@ var Inputs;
Inputs["EnableCrossOsArchive"] = "enableCrossOsArchive";
Inputs["FailOnCacheMiss"] = "fail-on-cache-miss";
Inputs["LookupOnly"] = "lookup-only"; // Input for cache, restore action
})(Inputs = exports.Inputs || (exports.Inputs = {}));
})(Inputs || (exports.Inputs = Inputs = {}));
var Outputs;
(function (Outputs) {
Outputs["CacheHit"] = "cache-hit";
Outputs["CachePrimaryKey"] = "cache-primary-key";
Outputs["CacheMatchedKey"] = "cache-matched-key"; // Output from restore action
})(Outputs = exports.Outputs || (exports.Outputs = {}));
})(Outputs || (exports.Outputs = Outputs = {}));
var State;
(function (State) {
State["CachePrimaryKey"] = "CACHE_KEY";
State["CacheMatchedKey"] = "CACHE_RESULT";
})(State = exports.State || (exports.State = {}));
})(State || (exports.State = State = {}));
var Events;
(function (Events) {
Events["Key"] = "GITHUB_EVENT_NAME";
Events["Push"] = "push";
Events["PullRequest"] = "pull_request";
})(Events = exports.Events || (exports.Events = {}));
})(Events || (exports.Events = Events = {}));
exports.RefKey = "GITHUB_REF";
@ -64956,13 +64956,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
@ -64973,7 +64983,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.restoreRun = exports.restoreOnlyRun = exports.restoreImpl = void 0;
exports.restoreImpl = restoreImpl;
exports.restoreOnlyRun = restoreOnlyRun;
exports.restoreRun = restoreRun;
const cache = __importStar(__nccwpck_require__(5116));
const core = __importStar(__nccwpck_require__(7484));
const constants_1 = __nccwpck_require__(7242);
@ -65033,7 +65045,6 @@ function restoreImpl(stateProvider, earlyExit) {
}
});
}
exports.restoreImpl = restoreImpl;
function run(stateProvider, earlyExit) {
return __awaiter(this, void 0, void 0, function* () {
yield restoreImpl(stateProvider, earlyExit);
@ -65052,13 +65063,11 @@ function restoreOnlyRun(earlyExit) {
yield run(new stateProvider_1.NullStateProvider(), earlyExit);
});
}
exports.restoreOnlyRun = restoreOnlyRun;
function restoreRun(earlyExit) {
return __awaiter(this, void 0, void 0, function* () {
yield run(new stateProvider_1.StateProvider(), earlyExit);
});
}
exports.restoreRun = restoreRun;
/***/ }),
@ -65084,13 +65093,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.NullStateProvider = exports.StateProvider = void 0;
const core = __importStar(__nccwpck_require__(7484));
@ -65159,15 +65178,32 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isCacheFeatureAvailable = exports.getInputAsBool = exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.isExactKeyMatch = exports.isGhes = void 0;
exports.isGhes = isGhes;
exports.isExactKeyMatch = isExactKeyMatch;
exports.logWarning = logWarning;
exports.isValidEvent = isValidEvent;
exports.getInputAsArray = getInputAsArray;
exports.getInputAsInt = getInputAsInt;
exports.getInputAsBool = getInputAsBool;
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
const cache = __importStar(__nccwpck_require__(5116));
const core = __importStar(__nccwpck_require__(7484));
const constants_1 = __nccwpck_require__(7242);
@ -65179,25 +65215,21 @@ function isGhes() {
const isLocalHost = hostname.endsWith(".LOCALHOST");
return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
}
exports.isGhes = isGhes;
function isExactKeyMatch(key, cacheKey) {
return !!(cacheKey &&
cacheKey.localeCompare(key, undefined, {
sensitivity: "accent"
}) === 0);
}
exports.isExactKeyMatch = isExactKeyMatch;
function logWarning(message) {
const warningPrefix = "[warning]";
core.info(`${warningPrefix}${message}`);
}
exports.logWarning = logWarning;
// Cache token authorized for all events that are tied to a ref
// See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context
function isValidEvent() {
return constants_1.RefKey in process.env && Boolean(process.env[constants_1.RefKey]);
}
exports.isValidEvent = isValidEvent;
function getInputAsArray(name, options) {
return core
.getInput(name, options)
@ -65205,7 +65237,6 @@ function getInputAsArray(name, options) {
.map(s => s.replace(/^!\s+/, "!").trim())
.filter(x => x !== "");
}
exports.getInputAsArray = getInputAsArray;
function getInputAsInt(name, options) {
const value = parseInt(core.getInput(name, options));
if (isNaN(value) || value < 0) {
@ -65213,12 +65244,10 @@ function getInputAsInt(name, options) {
}
return value;
}
exports.getInputAsInt = getInputAsInt;
function getInputAsBool(name, options) {
const result = core.getInput(name, options);
return result.toLowerCase() === "true";
}
exports.getInputAsBool = getInputAsBool;
function isCacheFeatureAvailable() {
if (cache.isFeatureAvailable()) {
return true;
@ -65231,7 +65260,6 @@ Otherwise please upgrade to GHES version >= 3.5 and If you are also using Github
logWarning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.");
return false;
}
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/***/ }),

104
dist/restore/index.js vendored
View File

@ -64912,24 +64912,24 @@ var Inputs;
Inputs["EnableCrossOsArchive"] = "enableCrossOsArchive";
Inputs["FailOnCacheMiss"] = "fail-on-cache-miss";
Inputs["LookupOnly"] = "lookup-only"; // Input for cache, restore action
})(Inputs = exports.Inputs || (exports.Inputs = {}));
})(Inputs || (exports.Inputs = Inputs = {}));
var Outputs;
(function (Outputs) {
Outputs["CacheHit"] = "cache-hit";
Outputs["CachePrimaryKey"] = "cache-primary-key";
Outputs["CacheMatchedKey"] = "cache-matched-key"; // Output from restore action
})(Outputs = exports.Outputs || (exports.Outputs = {}));
})(Outputs || (exports.Outputs = Outputs = {}));
var State;
(function (State) {
State["CachePrimaryKey"] = "CACHE_KEY";
State["CacheMatchedKey"] = "CACHE_RESULT";
})(State = exports.State || (exports.State = {}));
})(State || (exports.State = State = {}));
var Events;
(function (Events) {
Events["Key"] = "GITHUB_EVENT_NAME";
Events["Push"] = "push";
Events["PullRequest"] = "pull_request";
})(Events = exports.Events || (exports.Events = {}));
})(Events || (exports.Events = Events = {}));
exports.RefKey = "GITHUB_REF";
@ -64956,13 +64956,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
@ -64973,7 +64983,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.restoreRun = exports.restoreOnlyRun = exports.restoreImpl = void 0;
exports.restoreImpl = restoreImpl;
exports.restoreOnlyRun = restoreOnlyRun;
exports.restoreRun = restoreRun;
const cache = __importStar(__nccwpck_require__(5116));
const core = __importStar(__nccwpck_require__(7484));
const constants_1 = __nccwpck_require__(7242);
@ -65033,7 +65045,6 @@ function restoreImpl(stateProvider, earlyExit) {
}
});
}
exports.restoreImpl = restoreImpl;
function run(stateProvider, earlyExit) {
return __awaiter(this, void 0, void 0, function* () {
yield restoreImpl(stateProvider, earlyExit);
@ -65052,13 +65063,11 @@ function restoreOnlyRun(earlyExit) {
yield run(new stateProvider_1.NullStateProvider(), earlyExit);
});
}
exports.restoreOnlyRun = restoreOnlyRun;
function restoreRun(earlyExit) {
return __awaiter(this, void 0, void 0, function* () {
yield run(new stateProvider_1.StateProvider(), earlyExit);
});
}
exports.restoreRun = restoreRun;
/***/ }),
@ -65084,13 +65093,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.NullStateProvider = exports.StateProvider = void 0;
const core = __importStar(__nccwpck_require__(7484));
@ -65159,15 +65178,32 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isCacheFeatureAvailable = exports.getInputAsBool = exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.isExactKeyMatch = exports.isGhes = void 0;
exports.isGhes = isGhes;
exports.isExactKeyMatch = isExactKeyMatch;
exports.logWarning = logWarning;
exports.isValidEvent = isValidEvent;
exports.getInputAsArray = getInputAsArray;
exports.getInputAsInt = getInputAsInt;
exports.getInputAsBool = getInputAsBool;
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
const cache = __importStar(__nccwpck_require__(5116));
const core = __importStar(__nccwpck_require__(7484));
const constants_1 = __nccwpck_require__(7242);
@ -65179,25 +65215,21 @@ function isGhes() {
const isLocalHost = hostname.endsWith(".LOCALHOST");
return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
}
exports.isGhes = isGhes;
function isExactKeyMatch(key, cacheKey) {
return !!(cacheKey &&
cacheKey.localeCompare(key, undefined, {
sensitivity: "accent"
}) === 0);
}
exports.isExactKeyMatch = isExactKeyMatch;
function logWarning(message) {
const warningPrefix = "[warning]";
core.info(`${warningPrefix}${message}`);
}
exports.logWarning = logWarning;
// Cache token authorized for all events that are tied to a ref
// See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context
function isValidEvent() {
return constants_1.RefKey in process.env && Boolean(process.env[constants_1.RefKey]);
}
exports.isValidEvent = isValidEvent;
function getInputAsArray(name, options) {
return core
.getInput(name, options)
@ -65205,7 +65237,6 @@ function getInputAsArray(name, options) {
.map(s => s.replace(/^!\s+/, "!").trim())
.filter(x => x !== "");
}
exports.getInputAsArray = getInputAsArray;
function getInputAsInt(name, options) {
const value = parseInt(core.getInput(name, options));
if (isNaN(value) || value < 0) {
@ -65213,12 +65244,10 @@ function getInputAsInt(name, options) {
}
return value;
}
exports.getInputAsInt = getInputAsInt;
function getInputAsBool(name, options) {
const result = core.getInput(name, options);
return result.toLowerCase() === "true";
}
exports.getInputAsBool = getInputAsBool;
function isCacheFeatureAvailable() {
if (cache.isFeatureAvailable()) {
return true;
@ -65231,7 +65260,6 @@ Otherwise please upgrade to GHES version >= 3.5 and If you are also using Github
logWarning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.");
return false;
}
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/***/ }),

View File

@ -64912,24 +64912,24 @@ var Inputs;
Inputs["EnableCrossOsArchive"] = "enableCrossOsArchive";
Inputs["FailOnCacheMiss"] = "fail-on-cache-miss";
Inputs["LookupOnly"] = "lookup-only"; // Input for cache, restore action
})(Inputs = exports.Inputs || (exports.Inputs = {}));
})(Inputs || (exports.Inputs = Inputs = {}));
var Outputs;
(function (Outputs) {
Outputs["CacheHit"] = "cache-hit";
Outputs["CachePrimaryKey"] = "cache-primary-key";
Outputs["CacheMatchedKey"] = "cache-matched-key"; // Output from restore action
})(Outputs = exports.Outputs || (exports.Outputs = {}));
})(Outputs || (exports.Outputs = Outputs = {}));
var State;
(function (State) {
State["CachePrimaryKey"] = "CACHE_KEY";
State["CacheMatchedKey"] = "CACHE_RESULT";
})(State = exports.State || (exports.State = {}));
})(State || (exports.State = State = {}));
var Events;
(function (Events) {
Events["Key"] = "GITHUB_EVENT_NAME";
Events["Push"] = "push";
Events["PullRequest"] = "pull_request";
})(Events = exports.Events || (exports.Events = {}));
})(Events || (exports.Events = Events = {}));
exports.RefKey = "GITHUB_REF";
@ -64956,13 +64956,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
@ -64973,7 +64983,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.saveRun = exports.saveOnlyRun = exports.saveImpl = void 0;
exports.saveImpl = saveImpl;
exports.saveOnlyRun = saveOnlyRun;
exports.saveRun = saveRun;
const cache = __importStar(__nccwpck_require__(5116));
const core = __importStar(__nccwpck_require__(7484));
const constants_1 = __nccwpck_require__(7242);
@ -65024,7 +65036,6 @@ function saveImpl(stateProvider) {
return cacheId;
});
}
exports.saveImpl = saveImpl;
function saveOnlyRun(earlyExit) {
return __awaiter(this, void 0, void 0, function* () {
try {
@ -65049,7 +65060,6 @@ function saveOnlyRun(earlyExit) {
}
});
}
exports.saveOnlyRun = saveOnlyRun;
function saveRun(earlyExit) {
return __awaiter(this, void 0, void 0, function* () {
try {
@ -65071,7 +65081,6 @@ function saveRun(earlyExit) {
}
});
}
exports.saveRun = saveRun;
/***/ }),
@ -65097,13 +65106,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.NullStateProvider = exports.StateProvider = void 0;
const core = __importStar(__nccwpck_require__(7484));
@ -65172,15 +65191,32 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isCacheFeatureAvailable = exports.getInputAsBool = exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.isExactKeyMatch = exports.isGhes = void 0;
exports.isGhes = isGhes;
exports.isExactKeyMatch = isExactKeyMatch;
exports.logWarning = logWarning;
exports.isValidEvent = isValidEvent;
exports.getInputAsArray = getInputAsArray;
exports.getInputAsInt = getInputAsInt;
exports.getInputAsBool = getInputAsBool;
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
const cache = __importStar(__nccwpck_require__(5116));
const core = __importStar(__nccwpck_require__(7484));
const constants_1 = __nccwpck_require__(7242);
@ -65192,25 +65228,21 @@ function isGhes() {
const isLocalHost = hostname.endsWith(".LOCALHOST");
return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
}
exports.isGhes = isGhes;
function isExactKeyMatch(key, cacheKey) {
return !!(cacheKey &&
cacheKey.localeCompare(key, undefined, {
sensitivity: "accent"
}) === 0);
}
exports.isExactKeyMatch = isExactKeyMatch;
function logWarning(message) {
const warningPrefix = "[warning]";
core.info(`${warningPrefix}${message}`);
}
exports.logWarning = logWarning;
// Cache token authorized for all events that are tied to a ref
// See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context
function isValidEvent() {
return constants_1.RefKey in process.env && Boolean(process.env[constants_1.RefKey]);
}
exports.isValidEvent = isValidEvent;
function getInputAsArray(name, options) {
return core
.getInput(name, options)
@ -65218,7 +65250,6 @@ function getInputAsArray(name, options) {
.map(s => s.replace(/^!\s+/, "!").trim())
.filter(x => x !== "");
}
exports.getInputAsArray = getInputAsArray;
function getInputAsInt(name, options) {
const value = parseInt(core.getInput(name, options));
if (isNaN(value) || value < 0) {
@ -65226,12 +65257,10 @@ function getInputAsInt(name, options) {
}
return value;
}
exports.getInputAsInt = getInputAsInt;
function getInputAsBool(name, options) {
const result = core.getInput(name, options);
return result.toLowerCase() === "true";
}
exports.getInputAsBool = getInputAsBool;
function isCacheFeatureAvailable() {
if (cache.isFeatureAvailable()) {
return true;
@ -65244,7 +65273,6 @@ Otherwise please upgrade to GHES version >= 3.5 and If you are also using Github
logWarning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.");
return false;
}
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/***/ }),

104
dist/save/index.js vendored
View File

@ -64912,24 +64912,24 @@ var Inputs;
Inputs["EnableCrossOsArchive"] = "enableCrossOsArchive";
Inputs["FailOnCacheMiss"] = "fail-on-cache-miss";
Inputs["LookupOnly"] = "lookup-only"; // Input for cache, restore action
})(Inputs = exports.Inputs || (exports.Inputs = {}));
})(Inputs || (exports.Inputs = Inputs = {}));
var Outputs;
(function (Outputs) {
Outputs["CacheHit"] = "cache-hit";
Outputs["CachePrimaryKey"] = "cache-primary-key";
Outputs["CacheMatchedKey"] = "cache-matched-key"; // Output from restore action
})(Outputs = exports.Outputs || (exports.Outputs = {}));
})(Outputs || (exports.Outputs = Outputs = {}));
var State;
(function (State) {
State["CachePrimaryKey"] = "CACHE_KEY";
State["CacheMatchedKey"] = "CACHE_RESULT";
})(State = exports.State || (exports.State = {}));
})(State || (exports.State = State = {}));
var Events;
(function (Events) {
Events["Key"] = "GITHUB_EVENT_NAME";
Events["Push"] = "push";
Events["PullRequest"] = "pull_request";
})(Events = exports.Events || (exports.Events = {}));
})(Events || (exports.Events = Events = {}));
exports.RefKey = "GITHUB_REF";
@ -64956,13 +64956,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
@ -64973,7 +64983,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.saveRun = exports.saveOnlyRun = exports.saveImpl = void 0;
exports.saveImpl = saveImpl;
exports.saveOnlyRun = saveOnlyRun;
exports.saveRun = saveRun;
const cache = __importStar(__nccwpck_require__(5116));
const core = __importStar(__nccwpck_require__(7484));
const constants_1 = __nccwpck_require__(7242);
@ -65024,7 +65036,6 @@ function saveImpl(stateProvider) {
return cacheId;
});
}
exports.saveImpl = saveImpl;
function saveOnlyRun(earlyExit) {
return __awaiter(this, void 0, void 0, function* () {
try {
@ -65049,7 +65060,6 @@ function saveOnlyRun(earlyExit) {
}
});
}
exports.saveOnlyRun = saveOnlyRun;
function saveRun(earlyExit) {
return __awaiter(this, void 0, void 0, function* () {
try {
@ -65071,7 +65081,6 @@ function saveRun(earlyExit) {
}
});
}
exports.saveRun = saveRun;
/***/ }),
@ -65097,13 +65106,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.NullStateProvider = exports.StateProvider = void 0;
const core = __importStar(__nccwpck_require__(7484));
@ -65172,15 +65191,32 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importStar = (this && this.__importStar) || (function () {
var ownKeys = function(o) {
ownKeys = Object.getOwnPropertyNames || function (o) {
var ar = [];
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
return ar;
};
return ownKeys(o);
};
return function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
__setModuleDefault(result, mod);
return result;
};
})();
Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.isCacheFeatureAvailable = exports.getInputAsBool = exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.isExactKeyMatch = exports.isGhes = void 0;
exports.isGhes = isGhes;
exports.isExactKeyMatch = isExactKeyMatch;
exports.logWarning = logWarning;
exports.isValidEvent = isValidEvent;
exports.getInputAsArray = getInputAsArray;
exports.getInputAsInt = getInputAsInt;
exports.getInputAsBool = getInputAsBool;
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
const cache = __importStar(__nccwpck_require__(5116));
const core = __importStar(__nccwpck_require__(7484));
const constants_1 = __nccwpck_require__(7242);
@ -65192,25 +65228,21 @@ function isGhes() {
const isLocalHost = hostname.endsWith(".LOCALHOST");
return !isGitHubHost && !isGitHubEnterpriseCloudHost && !isLocalHost;
}
exports.isGhes = isGhes;
function isExactKeyMatch(key, cacheKey) {
return !!(cacheKey &&
cacheKey.localeCompare(key, undefined, {
sensitivity: "accent"
}) === 0);
}
exports.isExactKeyMatch = isExactKeyMatch;
function logWarning(message) {
const warningPrefix = "[warning]";
core.info(`${warningPrefix}${message}`);
}
exports.logWarning = logWarning;
// Cache token authorized for all events that are tied to a ref
// See GitHub Context https://help.github.com/actions/automating-your-workflow-with-github-actions/contexts-and-expression-syntax-for-github-actions#github-context
function isValidEvent() {
return constants_1.RefKey in process.env && Boolean(process.env[constants_1.RefKey]);
}
exports.isValidEvent = isValidEvent;
function getInputAsArray(name, options) {
return core
.getInput(name, options)
@ -65218,7 +65250,6 @@ function getInputAsArray(name, options) {
.map(s => s.replace(/^!\s+/, "!").trim())
.filter(x => x !== "");
}
exports.getInputAsArray = getInputAsArray;
function getInputAsInt(name, options) {
const value = parseInt(core.getInput(name, options));
if (isNaN(value) || value < 0) {
@ -65226,12 +65257,10 @@ function getInputAsInt(name, options) {
}
return value;
}
exports.getInputAsInt = getInputAsInt;
function getInputAsBool(name, options) {
const result = core.getInput(name, options);
return result.toLowerCase() === "true";
}
exports.getInputAsBool = getInputAsBool;
function isCacheFeatureAvailable() {
if (cache.isFeatureAvailable()) {
return true;
@ -65244,7 +65273,6 @@ Otherwise please upgrade to GHES version >= 3.5 and If you are also using Github
logWarning("An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.");
return false;
}
exports.isCacheFeatureAvailable = isCacheFeatureAvailable;
/***/ }),

14205
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -29,23 +29,26 @@
"@actions/io": "^1.1.3"
},
"devDependencies": {
"@types/jest": "^27.5.2",
"@types/jest": "^29.5.14",
"@types/nock": "^11.1.0",
"@types/node": "^16.18.3",
"@typescript-eslint/eslint-plugin": "^5.45.0",
"@typescript-eslint/parser": "^5.45.0",
"@types/node": "^24.1.0",
"@typescript-eslint/eslint-plugin": "^7.2.0",
"@typescript-eslint/parser": "^7.2.0",
"@vercel/ncc": "^0.38.3",
"eslint": "^8.28.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^26.9.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^7.0.0",
"jest": "^28.1.3",
"jest-circus": "^27.5.1",
"eslint-config-prettier": "^9.1.2",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-prettier": "^5.5.3",
"eslint-plugin-simple-import-sort": "^12.1.1",
"jest": "^29.7.0",
"jest-circus": "^29.7.0",
"nock": "^13.2.9",
"prettier": "^2.8.0",
"ts-jest": "^28.0.8",
"typescript": "^4.9.3"
"prettier": "^3.6.2",
"ts-jest": "^29.4.0",
"typescript": "^5.8.3"
},
"engines": {
"node": ">=24"
}
}

View File

@ -31,7 +31,7 @@ outputs:
cache-matched-key:
description: 'Key of the cache that was restored, it could either be the primary key on cache-hit or a partial/complete match of one of the restore keys'
runs:
using: 'node20'
using: 'node24'
main: '../dist/restore-only/index.js'
branding:
icon: 'archive'

View File

@ -16,7 +16,7 @@ inputs:
default: 'false'
required: false
runs:
using: 'node20'
using: 'node24'
main: '../dist/save-only/index.js'
branding:
icon: 'archive'