diff --git a/dist/index.js b/dist/index.js index ef5e92cc..343c8313 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1615,7 +1615,7 @@ const getOctokitClient = () => { const token = core.getInput('repo-token'); return (0, github_1.getOctokit)(token, undefined, plugin_retry_1.retry); }; -const checkCacheExist = (cacheKey) => __awaiter(void 0, void 0, void 0, function* () { +const checkIfCacheExists = (cacheKey) => __awaiter(void 0, void 0, void 0, function* () { const client = getOctokitClient(); try { const issueResult = yield client.request(`/repos/${github_1.context.repo.owner}/${github_1.context.repo.repo}/actions/caches`); @@ -1623,7 +1623,7 @@ const checkCacheExist = (cacheKey) => __awaiter(void 0, void 0, void 0, function return Boolean(caches.find(cache => cache['key'] === cacheKey)); } catch (error) { - core.debug(`$Error checking if cache exist: ${error.message}`); + core.debug(`Error checking if cache exist: ${error.message}`); } return false; }); @@ -1672,8 +1672,8 @@ class StateCacheStorage { const filePath = path_1.default.join(tmpDir, STATE_FILE); unlinkSafely(filePath); try { - const cacheExist = yield checkCacheExist(CACHE_KEY); - if (!cacheExist) { + const cacheExists = yield checkIfCacheExists(CACHE_KEY); + if (!cacheExists) { core.info('The saved state was not found, the process starts from the first issue.'); return ''; } diff --git a/src/classes/state/state-cache-storage.ts b/src/classes/state/state-cache-storage.ts index 96c98326..848872a3 100644 --- a/src/classes/state/state-cache-storage.ts +++ b/src/classes/state/state-cache-storage.ts @@ -30,7 +30,7 @@ const getOctokitClient = () => { return getOctokit(token, undefined, octokitRetry); }; -const checkCacheExist = async (cacheKey: string): Promise => { +const checkIfCacheExists = async (cacheKey: string): Promise => { const client = getOctokitClient(); try { const issueResult = await client.request( @@ -40,7 +40,7 @@ const checkCacheExist = async (cacheKey: string): Promise => { issueResult.data['actions_caches'] || []; return Boolean(caches.find(cache => cache['key'] === cacheKey)); } catch (error) { - core.debug(`$Error checking if cache exist: ${error.message}`); + core.debug(`Error checking if cache exist: ${error.message}`); } return false; }; @@ -92,8 +92,8 @@ export class StateCacheStorage implements IStateStorage { const filePath = path.join(tmpDir, STATE_FILE); unlinkSafely(filePath); try { - const cacheExist = await checkCacheExist(CACHE_KEY); - if (!cacheExist) { + const cacheExists = await checkIfCacheExists(CACHE_KEY); + if (!cacheExists) { core.info( 'The saved state was not found, the process starts from the first issue.' );