mirror of
https://github.com/actions/stale.git
synced 2025-12-10 03:57:04 +00:00
Fix spelling
This commit is contained in:
8
dist/index.js
vendored
8
dist/index.js
vendored
@@ -1615,7 +1615,7 @@ const getOctokitClient = () => {
|
|||||||
const token = core.getInput('repo-token');
|
const token = core.getInput('repo-token');
|
||||||
return (0, github_1.getOctokit)(token, undefined, plugin_retry_1.retry);
|
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();
|
const client = getOctokitClient();
|
||||||
try {
|
try {
|
||||||
const issueResult = yield client.request(`/repos/${github_1.context.repo.owner}/${github_1.context.repo.repo}/actions/caches`);
|
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));
|
return Boolean(caches.find(cache => cache['key'] === cacheKey));
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
core.debug(`$Error checking if cache exist: ${error.message}`);
|
core.debug(`Error checking if cache exist: ${error.message}`);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
@@ -1672,8 +1672,8 @@ class StateCacheStorage {
|
|||||||
const filePath = path_1.default.join(tmpDir, STATE_FILE);
|
const filePath = path_1.default.join(tmpDir, STATE_FILE);
|
||||||
unlinkSafely(filePath);
|
unlinkSafely(filePath);
|
||||||
try {
|
try {
|
||||||
const cacheExist = yield checkCacheExist(CACHE_KEY);
|
const cacheExists = yield checkIfCacheExists(CACHE_KEY);
|
||||||
if (!cacheExist) {
|
if (!cacheExists) {
|
||||||
core.info('The saved state was not found, the process starts from the first issue.');
|
core.info('The saved state was not found, the process starts from the first issue.');
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const getOctokitClient = () => {
|
|||||||
return getOctokit(token, undefined, octokitRetry);
|
return getOctokit(token, undefined, octokitRetry);
|
||||||
};
|
};
|
||||||
|
|
||||||
const checkCacheExist = async (cacheKey: string): Promise<boolean> => {
|
const checkIfCacheExists = async (cacheKey: string): Promise<boolean> => {
|
||||||
const client = getOctokitClient();
|
const client = getOctokitClient();
|
||||||
try {
|
try {
|
||||||
const issueResult = await client.request(
|
const issueResult = await client.request(
|
||||||
@@ -40,7 +40,7 @@ const checkCacheExist = async (cacheKey: string): Promise<boolean> => {
|
|||||||
issueResult.data['actions_caches'] || [];
|
issueResult.data['actions_caches'] || [];
|
||||||
return Boolean(caches.find(cache => cache['key'] === cacheKey));
|
return Boolean(caches.find(cache => cache['key'] === cacheKey));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.debug(`$Error checking if cache exist: ${error.message}`);
|
core.debug(`Error checking if cache exist: ${error.message}`);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
@@ -92,8 +92,8 @@ export class StateCacheStorage implements IStateStorage {
|
|||||||
const filePath = path.join(tmpDir, STATE_FILE);
|
const filePath = path.join(tmpDir, STATE_FILE);
|
||||||
unlinkSafely(filePath);
|
unlinkSafely(filePath);
|
||||||
try {
|
try {
|
||||||
const cacheExist = await checkCacheExist(CACHE_KEY);
|
const cacheExists = await checkIfCacheExists(CACHE_KEY);
|
||||||
if (!cacheExist) {
|
if (!cacheExists) {
|
||||||
core.info(
|
core.info(
|
||||||
'The saved state was not found, the process starts from the first issue.'
|
'The saved state was not found, the process starts from the first issue.'
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user