Fix: Remove event validation

This commit is contained in:
Andreas Möller 2020-05-17 10:25:49 +02:00
parent 16a133d9a7
commit 9572935725
No known key found for this signature in database
GPG key ID: 9FB20A0BAF60E11F
9 changed files with 3 additions and 116 deletions

11
dist/save/index.js vendored
View file

@ -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";
/***/ }),