Compare commits
	
		
			2 Commits
		
	
	
		
			enableForG
			...
			90c49f2166
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					90c49f2166 | ||
| 
						 | 
					d0f267fa32 | 
@@ -17,6 +17,24 @@ afterEach(() => {
 | 
				
			|||||||
    delete process.env[RefKey];
 | 
					    delete process.env[RefKey];
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test("isGhes returns true if server url is not github.com", () => {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					        process.env["GITHUB_SERVER_URL"] = "http://example.com";
 | 
				
			||||||
 | 
					        expect(actionUtils.isGhes()).toBe(true);
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					        process.env["GITHUB_SERVER_URL"] = undefined;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test("isGhes returns true when server url is github.com", () => {
 | 
				
			||||||
 | 
					    try {
 | 
				
			||||||
 | 
					        process.env["GITHUB_SERVER_URL"] = "http://github.com";
 | 
				
			||||||
 | 
					        expect(actionUtils.isGhes()).toBe(false);
 | 
				
			||||||
 | 
					    } finally {
 | 
				
			||||||
 | 
					        process.env["GITHUB_SERVER_URL"] = undefined;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test("isExactKeyMatch with undefined cache key returns false", () => {
 | 
					test("isExactKeyMatch with undefined cache key returns false", () => {
 | 
				
			||||||
    const key = "linux-rust";
 | 
					    const key = "linux-rust";
 | 
				
			||||||
    const cacheKey = undefined;
 | 
					    const cacheKey = undefined;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,6 +32,8 @@ beforeAll(() => {
 | 
				
			|||||||
beforeEach(() => {
 | 
					beforeEach(() => {
 | 
				
			||||||
    process.env[Events.Key] = Events.Push;
 | 
					    process.env[Events.Key] = Events.Push;
 | 
				
			||||||
    process.env[RefKey] = "refs/heads/feature-branch";
 | 
					    process.env[RefKey] = "refs/heads/feature-branch";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
afterEach(() => {
 | 
					afterEach(() => {
 | 
				
			||||||
@@ -53,6 +55,23 @@ test("restore with invalid event outputs warning", async () => {
 | 
				
			|||||||
    expect(failedMock).toHaveBeenCalledTimes(0);
 | 
					    expect(failedMock).toHaveBeenCalledTimes(0);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test("restore on GHES should no-op", async () => {
 | 
				
			||||||
 | 
					    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const logWarningMock = jest.spyOn(actionUtils, "logWarning");
 | 
				
			||||||
 | 
					    const restoreCacheMock = jest.spyOn(cache, "restoreCache");
 | 
				
			||||||
 | 
					    const setCacheHitOutputMock = jest.spyOn(actionUtils, "setCacheHitOutput");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    await run();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    expect(restoreCacheMock).toHaveBeenCalledTimes(0);
 | 
				
			||||||
 | 
					    expect(setCacheHitOutputMock).toHaveBeenCalledTimes(1);
 | 
				
			||||||
 | 
					    expect(setCacheHitOutputMock).toHaveBeenCalledWith(false);
 | 
				
			||||||
 | 
					    expect(logWarningMock).toHaveBeenCalledWith(
 | 
				
			||||||
 | 
					        "Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test("restore with no path should fail", async () => {
 | 
					test("restore with no path should fail", async () => {
 | 
				
			||||||
    const failedMock = jest.spyOn(core, "setFailed");
 | 
					    const failedMock = jest.spyOn(core, "setFailed");
 | 
				
			||||||
    const restoreCacheMock = jest.spyOn(cache, "restoreCache");
 | 
					    const restoreCacheMock = jest.spyOn(cache, "restoreCache");
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -52,6 +52,8 @@ beforeAll(() => {
 | 
				
			|||||||
beforeEach(() => {
 | 
					beforeEach(() => {
 | 
				
			||||||
    process.env[Events.Key] = Events.Push;
 | 
					    process.env[Events.Key] = Events.Push;
 | 
				
			||||||
    process.env[RefKey] = "refs/heads/feature-branch";
 | 
					    process.env[RefKey] = "refs/heads/feature-branch";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => false);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
afterEach(() => {
 | 
					afterEach(() => {
 | 
				
			||||||
@@ -99,6 +101,20 @@ test("save with no primary key in state outputs warning", async () => {
 | 
				
			|||||||
    expect(failedMock).toHaveBeenCalledTimes(0);
 | 
					    expect(failedMock).toHaveBeenCalledTimes(0);
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test("save on GHES should no-op", async () => {
 | 
				
			||||||
 | 
					    jest.spyOn(actionUtils, "isGhes").mockImplementation(() => true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const logWarningMock = jest.spyOn(actionUtils, "logWarning");
 | 
				
			||||||
 | 
					    const saveCacheMock = jest.spyOn(cache, "saveCache");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    await run();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    expect(saveCacheMock).toHaveBeenCalledTimes(0);
 | 
				
			||||||
 | 
					    expect(logWarningMock).toHaveBeenCalledWith(
 | 
				
			||||||
 | 
					        "Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test("save with exact match returns early", async () => {
 | 
					test("save with exact match returns early", async () => {
 | 
				
			||||||
    const infoMock = jest.spyOn(core, "info");
 | 
					    const infoMock = jest.spyOn(core, "info");
 | 
				
			||||||
    const failedMock = jest.spyOn(core, "setFailed");
 | 
					    const failedMock = jest.spyOn(core, "setFailed");
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										42
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										42
									
								
								dist/restore/index.js
									
									
									
									
										vendored
									
									
								
							@@ -36328,9 +36328,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
 | 
				
			|||||||
    return result;
 | 
					    return result;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
Object.defineProperty(exports, "__esModule", { value: true });
 | 
					Object.defineProperty(exports, "__esModule", { value: true });
 | 
				
			||||||
exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.getCacheState = exports.setOutputAndState = exports.setCacheHitOutput = exports.setCacheState = exports.isExactKeyMatch = void 0;
 | 
					exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.getCacheState = exports.setOutputAndState = exports.setCacheHitOutput = exports.setCacheState = exports.isExactKeyMatch = exports.isGhes = void 0;
 | 
				
			||||||
const core = __importStar(__webpack_require__(470));
 | 
					const core = __importStar(__webpack_require__(470));
 | 
				
			||||||
const constants_1 = __webpack_require__(196);
 | 
					const constants_1 = __webpack_require__(196);
 | 
				
			||||||
 | 
					function isGhes() {
 | 
				
			||||||
 | 
					    const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com");
 | 
				
			||||||
 | 
					    return ghUrl.hostname.toUpperCase() !== "GITHUB.COM";
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					exports.isGhes = isGhes;
 | 
				
			||||||
function isExactKeyMatch(key, cacheKey) {
 | 
					function isExactKeyMatch(key, cacheKey) {
 | 
				
			||||||
    return !!(cacheKey &&
 | 
					    return !!(cacheKey &&
 | 
				
			||||||
        cacheKey.localeCompare(key, undefined, {
 | 
					        cacheKey.localeCompare(key, undefined, {
 | 
				
			||||||
@@ -37898,9 +37903,17 @@ AbortError.prototype = Object.create(Error.prototype);
 | 
				
			|||||||
AbortError.prototype.constructor = AbortError;
 | 
					AbortError.prototype.constructor = AbortError;
 | 
				
			||||||
AbortError.prototype.name = 'AbortError';
 | 
					AbortError.prototype.name = 'AbortError';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const URL$1 = Url.URL || whatwgUrl.URL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
 | 
					// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
 | 
				
			||||||
const PassThrough$1 = Stream.PassThrough;
 | 
					const PassThrough$1 = Stream.PassThrough;
 | 
				
			||||||
const resolve_url = Url.resolve;
 | 
					
 | 
				
			||||||
 | 
					const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
 | 
				
			||||||
 | 
						const orig = new URL$1(original).hostname;
 | 
				
			||||||
 | 
						const dest = new URL$1(destination).hostname;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Fetch function
 | 
					 * Fetch function
 | 
				
			||||||
@@ -37988,7 +38001,19 @@ function fetch(url, opts) {
 | 
				
			|||||||
				const location = headers.get('Location');
 | 
									const location = headers.get('Location');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				// HTTP fetch step 5.3
 | 
									// HTTP fetch step 5.3
 | 
				
			||||||
				const locationURL = location === null ? null : resolve_url(request.url, location);
 | 
									let locationURL = null;
 | 
				
			||||||
 | 
									try {
 | 
				
			||||||
 | 
										locationURL = location === null ? null : new URL$1(location, request.url).toString();
 | 
				
			||||||
 | 
									} catch (err) {
 | 
				
			||||||
 | 
										// error here can only be invalid URL in Location: header
 | 
				
			||||||
 | 
										// do not throw when options.redirect == manual
 | 
				
			||||||
 | 
										// let the user extract the errorneous redirect URL
 | 
				
			||||||
 | 
										if (request.redirect !== 'manual') {
 | 
				
			||||||
 | 
											reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
 | 
				
			||||||
 | 
											finalize();
 | 
				
			||||||
 | 
											return;
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				// HTTP fetch step 5.5
 | 
									// HTTP fetch step 5.5
 | 
				
			||||||
				switch (request.redirect) {
 | 
									switch (request.redirect) {
 | 
				
			||||||
@@ -38036,6 +38061,12 @@ function fetch(url, opts) {
 | 
				
			|||||||
							size: request.size
 | 
												size: request.size
 | 
				
			||||||
						};
 | 
											};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
											if (!isDomainOrSubdomain(request.url, locationURL)) {
 | 
				
			||||||
 | 
												for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
 | 
				
			||||||
 | 
													requestOpts.headers.delete(name);
 | 
				
			||||||
 | 
												}
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						// HTTP-redirect fetch step 9
 | 
											// HTTP-redirect fetch step 9
 | 
				
			||||||
						if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
 | 
											if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
 | 
				
			||||||
							reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
 | 
												reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
 | 
				
			||||||
@@ -46714,6 +46745,11 @@ const utils = __importStar(__webpack_require__(443));
 | 
				
			|||||||
function run() {
 | 
					function run() {
 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
 | 
					            if (utils.isGhes()) {
 | 
				
			||||||
 | 
					                utils.logWarning("Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details");
 | 
				
			||||||
 | 
					                utils.setCacheHitOutput(false);
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            // Validate inputs, this can cause task failure
 | 
					            // Validate inputs, this can cause task failure
 | 
				
			||||||
            if (!utils.isValidEvent()) {
 | 
					            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.`);
 | 
					                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.`);
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										41
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										41
									
								
								dist/save/index.js
									
									
									
									
										vendored
									
									
								
							@@ -36328,9 +36328,14 @@ var __importStar = (this && this.__importStar) || function (mod) {
 | 
				
			|||||||
    return result;
 | 
					    return result;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
Object.defineProperty(exports, "__esModule", { value: true });
 | 
					Object.defineProperty(exports, "__esModule", { value: true });
 | 
				
			||||||
exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.getCacheState = exports.setOutputAndState = exports.setCacheHitOutput = exports.setCacheState = exports.isExactKeyMatch = void 0;
 | 
					exports.getInputAsInt = exports.getInputAsArray = exports.isValidEvent = exports.logWarning = exports.getCacheState = exports.setOutputAndState = exports.setCacheHitOutput = exports.setCacheState = exports.isExactKeyMatch = exports.isGhes = void 0;
 | 
				
			||||||
const core = __importStar(__webpack_require__(470));
 | 
					const core = __importStar(__webpack_require__(470));
 | 
				
			||||||
const constants_1 = __webpack_require__(196);
 | 
					const constants_1 = __webpack_require__(196);
 | 
				
			||||||
 | 
					function isGhes() {
 | 
				
			||||||
 | 
					    const ghUrl = new URL(process.env["GITHUB_SERVER_URL"] || "https://github.com");
 | 
				
			||||||
 | 
					    return ghUrl.hostname.toUpperCase() !== "GITHUB.COM";
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					exports.isGhes = isGhes;
 | 
				
			||||||
function isExactKeyMatch(key, cacheKey) {
 | 
					function isExactKeyMatch(key, cacheKey) {
 | 
				
			||||||
    return !!(cacheKey &&
 | 
					    return !!(cacheKey &&
 | 
				
			||||||
        cacheKey.localeCompare(key, undefined, {
 | 
					        cacheKey.localeCompare(key, undefined, {
 | 
				
			||||||
@@ -37898,9 +37903,17 @@ AbortError.prototype = Object.create(Error.prototype);
 | 
				
			|||||||
AbortError.prototype.constructor = AbortError;
 | 
					AbortError.prototype.constructor = AbortError;
 | 
				
			||||||
AbortError.prototype.name = 'AbortError';
 | 
					AbortError.prototype.name = 'AbortError';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const URL$1 = Url.URL || whatwgUrl.URL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
 | 
					// fix an issue where "PassThrough", "resolve" aren't a named export for node <10
 | 
				
			||||||
const PassThrough$1 = Stream.PassThrough;
 | 
					const PassThrough$1 = Stream.PassThrough;
 | 
				
			||||||
const resolve_url = Url.resolve;
 | 
					
 | 
				
			||||||
 | 
					const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original) {
 | 
				
			||||||
 | 
						const orig = new URL$1(original).hostname;
 | 
				
			||||||
 | 
						const dest = new URL$1(destination).hostname;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * Fetch function
 | 
					 * Fetch function
 | 
				
			||||||
@@ -37988,7 +38001,19 @@ function fetch(url, opts) {
 | 
				
			|||||||
				const location = headers.get('Location');
 | 
									const location = headers.get('Location');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				// HTTP fetch step 5.3
 | 
									// HTTP fetch step 5.3
 | 
				
			||||||
				const locationURL = location === null ? null : resolve_url(request.url, location);
 | 
									let locationURL = null;
 | 
				
			||||||
 | 
									try {
 | 
				
			||||||
 | 
										locationURL = location === null ? null : new URL$1(location, request.url).toString();
 | 
				
			||||||
 | 
									} catch (err) {
 | 
				
			||||||
 | 
										// error here can only be invalid URL in Location: header
 | 
				
			||||||
 | 
										// do not throw when options.redirect == manual
 | 
				
			||||||
 | 
										// let the user extract the errorneous redirect URL
 | 
				
			||||||
 | 
										if (request.redirect !== 'manual') {
 | 
				
			||||||
 | 
											reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'));
 | 
				
			||||||
 | 
											finalize();
 | 
				
			||||||
 | 
											return;
 | 
				
			||||||
 | 
										}
 | 
				
			||||||
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				// HTTP fetch step 5.5
 | 
									// HTTP fetch step 5.5
 | 
				
			||||||
				switch (request.redirect) {
 | 
									switch (request.redirect) {
 | 
				
			||||||
@@ -38036,6 +38061,12 @@ function fetch(url, opts) {
 | 
				
			|||||||
							size: request.size
 | 
												size: request.size
 | 
				
			||||||
						};
 | 
											};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
											if (!isDomainOrSubdomain(request.url, locationURL)) {
 | 
				
			||||||
 | 
												for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
 | 
				
			||||||
 | 
													requestOpts.headers.delete(name);
 | 
				
			||||||
 | 
												}
 | 
				
			||||||
 | 
											}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
						// HTTP-redirect fetch step 9
 | 
											// HTTP-redirect fetch step 9
 | 
				
			||||||
						if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
 | 
											if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
 | 
				
			||||||
							reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
 | 
												reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
 | 
				
			||||||
@@ -44900,6 +44931,10 @@ process.on("uncaughtException", e => utils.logWarning(e.message));
 | 
				
			|||||||
function run() {
 | 
					function run() {
 | 
				
			||||||
    return __awaiter(this, void 0, void 0, function* () {
 | 
					    return __awaiter(this, void 0, void 0, function* () {
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
 | 
					            if (utils.isGhes()) {
 | 
				
			||||||
 | 
					                utils.logWarning("Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details");
 | 
				
			||||||
 | 
					                return;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
            if (!utils.isValidEvent()) {
 | 
					            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.`);
 | 
					                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;
 | 
					                return;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										60
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										60
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@@ -840,9 +840,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "@types/node": {
 | 
					    "@types/node": {
 | 
				
			||||||
      "version": "12.20.37",
 | 
					      "version": "12.20.42",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.37.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.42.tgz",
 | 
				
			||||||
      "integrity": "sha512-i1KGxqcvJaLQali+WuypQnXwcplhtNtjs66eNsZpp2P2FL/trJJxx/VWsM0YCL2iMoIJrbXje48lvIQAQ4p2ZA=="
 | 
					      "integrity": "sha512-aI3/oo5DzyiI5R/xAhxxRzfZlWlsbbqdgxfTPkqu/Zt+23GXiJvMCyPJT4+xKSXOnLqoL8jJYMLTwvK2M3a5hw=="
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "@types/node-fetch": {
 | 
					    "@types/node-fetch": {
 | 
				
			||||||
      "version": "2.5.12",
 | 
					      "version": "2.5.12",
 | 
				
			||||||
@@ -2071,14 +2071,13 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "eslint-module-utils": {
 | 
					    "eslint-module-utils": {
 | 
				
			||||||
      "version": "2.7.1",
 | 
					      "version": "2.7.2",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.1.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.2.tgz",
 | 
				
			||||||
      "integrity": "sha512-fjoetBXQZq2tSTWZ9yWVl2KuFrTZZH3V+9iD1V1RfpDgxzJR+mPd/KZmMiA8gbPqdBzpNiEHOuT7IYEWxrH0zQ==",
 | 
					      "integrity": "sha512-zquepFnWCY2ISMFwD/DqzaM++H+7PDzOpUvotJWm/y1BAFt5R4oeULgdrTejKqLkz7MA/tgstsUMNYc7wNdTrg==",
 | 
				
			||||||
      "dev": true,
 | 
					      "dev": true,
 | 
				
			||||||
      "requires": {
 | 
					      "requires": {
 | 
				
			||||||
        "debug": "^3.2.7",
 | 
					        "debug": "^3.2.7",
 | 
				
			||||||
        "find-up": "^2.1.0",
 | 
					        "find-up": "^2.1.0"
 | 
				
			||||||
        "pkg-dir": "^2.0.0"
 | 
					 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "debug": {
 | 
					        "debug": {
 | 
				
			||||||
@@ -2093,9 +2092,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "eslint-plugin-import": {
 | 
					    "eslint-plugin-import": {
 | 
				
			||||||
      "version": "2.25.3",
 | 
					      "version": "2.25.4",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.3.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.25.4.tgz",
 | 
				
			||||||
      "integrity": "sha512-RzAVbby+72IB3iOEL8clzPLzL3wpDrlwjsTBAQXgyp5SeTqqY+0bFubwuo+y/HLhNZcXV4XqTBO4LGsfyHIDXg==",
 | 
					      "integrity": "sha512-/KJBASVFxpu0xg1kIBn9AUa8hQVnszpwgE7Ld0lKAlx7Ie87yzEzCgSkekt+le/YVhiaosO4Y14GDAOc41nfxA==",
 | 
				
			||||||
      "dev": true,
 | 
					      "dev": true,
 | 
				
			||||||
      "requires": {
 | 
					      "requires": {
 | 
				
			||||||
        "array-includes": "^3.1.4",
 | 
					        "array-includes": "^3.1.4",
 | 
				
			||||||
@@ -2103,14 +2102,14 @@
 | 
				
			|||||||
        "debug": "^2.6.9",
 | 
					        "debug": "^2.6.9",
 | 
				
			||||||
        "doctrine": "^2.1.0",
 | 
					        "doctrine": "^2.1.0",
 | 
				
			||||||
        "eslint-import-resolver-node": "^0.3.6",
 | 
					        "eslint-import-resolver-node": "^0.3.6",
 | 
				
			||||||
        "eslint-module-utils": "^2.7.1",
 | 
					        "eslint-module-utils": "^2.7.2",
 | 
				
			||||||
        "has": "^1.0.3",
 | 
					        "has": "^1.0.3",
 | 
				
			||||||
        "is-core-module": "^2.8.0",
 | 
					        "is-core-module": "^2.8.0",
 | 
				
			||||||
        "is-glob": "^4.0.3",
 | 
					        "is-glob": "^4.0.3",
 | 
				
			||||||
        "minimatch": "^3.0.4",
 | 
					        "minimatch": "^3.0.4",
 | 
				
			||||||
        "object.values": "^1.1.5",
 | 
					        "object.values": "^1.1.5",
 | 
				
			||||||
        "resolve": "^1.20.0",
 | 
					        "resolve": "^1.20.0",
 | 
				
			||||||
        "tsconfig-paths": "^3.11.0"
 | 
					        "tsconfig-paths": "^3.12.0"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
      "dependencies": {
 | 
					      "dependencies": {
 | 
				
			||||||
        "debug": {
 | 
					        "debug": {
 | 
				
			||||||
@@ -3998,9 +3997,9 @@
 | 
				
			|||||||
      "dev": true
 | 
					      "dev": true
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "json-schema": {
 | 
					    "json-schema": {
 | 
				
			||||||
      "version": "0.2.3",
 | 
					      "version": "0.4.0",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
 | 
				
			||||||
      "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=",
 | 
					      "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==",
 | 
				
			||||||
      "dev": true
 | 
					      "dev": true
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "json-schema-traverse": {
 | 
					    "json-schema-traverse": {
 | 
				
			||||||
@@ -4031,14 +4030,14 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "jsprim": {
 | 
					    "jsprim": {
 | 
				
			||||||
      "version": "1.4.1",
 | 
					      "version": "1.4.2",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz",
 | 
				
			||||||
      "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=",
 | 
					      "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==",
 | 
				
			||||||
      "dev": true,
 | 
					      "dev": true,
 | 
				
			||||||
      "requires": {
 | 
					      "requires": {
 | 
				
			||||||
        "assert-plus": "1.0.0",
 | 
					        "assert-plus": "1.0.0",
 | 
				
			||||||
        "extsprintf": "1.3.0",
 | 
					        "extsprintf": "1.3.0",
 | 
				
			||||||
        "json-schema": "0.2.3",
 | 
					        "json-schema": "0.4.0",
 | 
				
			||||||
        "verror": "1.10.0"
 | 
					        "verror": "1.10.0"
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
@@ -4327,9 +4326,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "node-fetch": {
 | 
					    "node-fetch": {
 | 
				
			||||||
      "version": "2.6.6",
 | 
					      "version": "2.6.7",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.6.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
 | 
				
			||||||
      "integrity": "sha512-Z8/6vRlTUChSdIgMa51jxQ4lrw/Jy5SOW10ObaA47/RElsAN2c5Pn8bTgFGWn/ibwzXTE8qwr1Yzx28vsecXEA==",
 | 
					      "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
 | 
				
			||||||
      "requires": {
 | 
					      "requires": {
 | 
				
			||||||
        "whatwg-url": "^5.0.0"
 | 
					        "whatwg-url": "^5.0.0"
 | 
				
			||||||
      },
 | 
					      },
 | 
				
			||||||
@@ -4764,15 +4763,6 @@
 | 
				
			|||||||
        "node-modules-regexp": "^1.0.0"
 | 
					        "node-modules-regexp": "^1.0.0"
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "pkg-dir": {
 | 
					 | 
				
			||||||
      "version": "2.0.0",
 | 
					 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz",
 | 
					 | 
				
			||||||
      "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=",
 | 
					 | 
				
			||||||
      "dev": true,
 | 
					 | 
				
			||||||
      "requires": {
 | 
					 | 
				
			||||||
        "find-up": "^2.1.0"
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
    "pn": {
 | 
					    "pn": {
 | 
				
			||||||
      "version": "1.1.0",
 | 
					      "version": "1.1.0",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz",
 | 
				
			||||||
@@ -6121,9 +6111,9 @@
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "tsconfig-paths": {
 | 
					    "tsconfig-paths": {
 | 
				
			||||||
      "version": "3.11.0",
 | 
					      "version": "3.12.0",
 | 
				
			||||||
      "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz",
 | 
					      "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.12.0.tgz",
 | 
				
			||||||
      "integrity": "sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA==",
 | 
					      "integrity": "sha512-e5adrnOYT6zqVnWqZu7i/BQ3BnhzvGbjEjejFXO20lKIKpwTaupkCPgEfv4GZK1IBciJUEhYs3J3p75FdaTFVg==",
 | 
				
			||||||
      "dev": true,
 | 
					      "dev": true,
 | 
				
			||||||
      "requires": {
 | 
					      "requires": {
 | 
				
			||||||
        "@types/json5": "^0.0.29",
 | 
					        "@types/json5": "^0.0.29",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -31,13 +31,13 @@
 | 
				
			|||||||
  "devDependencies": {
 | 
					  "devDependencies": {
 | 
				
			||||||
    "@types/jest": "^24.0.13",
 | 
					    "@types/jest": "^24.0.13",
 | 
				
			||||||
    "@types/nock": "^11.1.0",
 | 
					    "@types/nock": "^11.1.0",
 | 
				
			||||||
    "@types/node": "^12.20.7",
 | 
					    "@types/node": "^12.20.42",
 | 
				
			||||||
    "@typescript-eslint/eslint-plugin": "^2.7.0",
 | 
					    "@typescript-eslint/eslint-plugin": "^2.7.0",
 | 
				
			||||||
    "@typescript-eslint/parser": "^2.7.0",
 | 
					    "@typescript-eslint/parser": "^2.7.0",
 | 
				
			||||||
    "@zeit/ncc": "^0.20.5",
 | 
					    "@zeit/ncc": "^0.20.5",
 | 
				
			||||||
    "eslint": "^6.6.0",
 | 
					    "eslint": "^6.6.0",
 | 
				
			||||||
    "eslint-config-prettier": "^6.15.0",
 | 
					    "eslint-config-prettier": "^6.15.0",
 | 
				
			||||||
    "eslint-plugin-import": "^2.22.1",
 | 
					    "eslint-plugin-import": "^2.25.4",
 | 
				
			||||||
    "eslint-plugin-jest": "^23.20.0",
 | 
					    "eslint-plugin-jest": "^23.20.0",
 | 
				
			||||||
    "eslint-plugin-prettier": "^3.3.1",
 | 
					    "eslint-plugin-prettier": "^3.3.1",
 | 
				
			||||||
    "eslint-plugin-simple-import-sort": "^5.0.2",
 | 
					    "eslint-plugin-simple-import-sort": "^5.0.2",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,6 +6,14 @@ import * as utils from "./utils/actionUtils";
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
async function run(): Promise<void> {
 | 
					async function run(): Promise<void> {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
 | 
					        if (utils.isGhes()) {
 | 
				
			||||||
 | 
					            utils.logWarning(
 | 
				
			||||||
 | 
					                "Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					            utils.setCacheHitOutput(false);
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        // Validate inputs, this can cause task failure
 | 
					        // Validate inputs, this can cause task failure
 | 
				
			||||||
        if (!utils.isValidEvent()) {
 | 
					        if (!utils.isValidEvent()) {
 | 
				
			||||||
            utils.logWarning(
 | 
					            utils.logWarning(
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -11,6 +11,13 @@ process.on("uncaughtException", e => utils.logWarning(e.message));
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
async function run(): Promise<void> {
 | 
					async function run(): Promise<void> {
 | 
				
			||||||
    try {
 | 
					    try {
 | 
				
			||||||
 | 
					        if (utils.isGhes()) {
 | 
				
			||||||
 | 
					            utils.logWarning(
 | 
				
			||||||
 | 
					                "Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
 | 
				
			||||||
 | 
					            );
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!utils.isValidEvent()) {
 | 
					        if (!utils.isValidEvent()) {
 | 
				
			||||||
            utils.logWarning(
 | 
					            utils.logWarning(
 | 
				
			||||||
                `Event Validation Error: The event type ${
 | 
					                `Event Validation Error: The event type ${
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,6 +2,13 @@ import * as core from "@actions/core";
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import { Outputs, RefKey, State } from "../constants";
 | 
					import { Outputs, RefKey, State } from "../constants";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					export function isGhes(): boolean {
 | 
				
			||||||
 | 
					    const ghUrl = new URL(
 | 
				
			||||||
 | 
					        process.env["GITHUB_SERVER_URL"] || "https://github.com"
 | 
				
			||||||
 | 
					    );
 | 
				
			||||||
 | 
					    return ghUrl.hostname.toUpperCase() !== "GITHUB.COM";
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export function isExactKeyMatch(key: string, cacheKey?: string): boolean {
 | 
					export function isExactKeyMatch(key: string, cacheKey?: string): boolean {
 | 
				
			||||||
    return !!(
 | 
					    return !!(
 | 
				
			||||||
        cacheKey &&
 | 
					        cacheKey &&
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user