work on resolving comments

This commit is contained in:
Dmitry Shibanov 2022-03-30 13:45:18 +02:00
parent 1c630f9ff8
commit 62e9de96c2
8 changed files with 64 additions and 49 deletions

View file

@ -97,11 +97,6 @@ export const getCacheDirectoryPath = async (
return stdOut;
};
function logWarning(message: string): void {
const warningPrefix = '[warning]';
core.info(`${warningPrefix}${message}`);
}
export function isGhes(): boolean {
const ghUrl = new URL(
process.env['GITHUB_SERVER_URL'] || 'https://github.com'
@ -112,15 +107,14 @@ export function isGhes(): boolean {
export function isCacheFeatureAvailable(): boolean {
if (!cache.isFeatureAvailable()) {
if (isGhes()) {
logWarning(
throw new Error(
'Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if Actions cache service is enabled or not.'
);
} else {
logWarning(
throw new Error(
'An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions.'
);
}
return false;
}
return true;