mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-22 00:33:57 +08:00
Fix: Remove event validation
This commit is contained in:
parent
16a133d9a7
commit
9572935725
9 changed files with 3 additions and 116 deletions
11
dist/save/index.js
vendored
11
dist/save/index.js
vendored
|
@ -3345,12 +3345,6 @@ function resolvePaths(patterns) {
|
|||
});
|
||||
}
|
||||
exports.resolvePaths = resolvePaths;
|
||||
// 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 unlinkFile(path) {
|
||||
return util.promisify(fs.unlink)(path);
|
||||
}
|
||||
|
@ -4597,10 +4591,6 @@ const utils = __importStar(__webpack_require__(443));
|
|||
function run() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
try {
|
||||
if (!utils.isValidEvent()) {
|
||||
utils.logWarning(`Event Validation Error: The event type ${process.env[constants_1.Events.Key]} is not supported because it's not tied to a branch or tag ref.`);
|
||||
return;
|
||||
}
|
||||
const state = utils.getCacheState();
|
||||
// Inputs are re-evaluted before the post action, so we want the original key used for restore
|
||||
const primaryKey = core.getState(constants_1.State.CacheKey);
|
||||
|
@ -4694,7 +4684,6 @@ var CompressionMethod;
|
|||
// over the socket during this period, the socket is destroyed and the download
|
||||
// is aborted.
|
||||
exports.SocketTimeout = 5000;
|
||||
exports.RefKey = "GITHUB_REF";
|
||||
|
||||
|
||||
/***/ }),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue