mirror of
https://github.com/actions/cache.git
synced 2025-06-18 23:02:57 -06:00
review comments and updated test cases
This commit is contained in:
parent
1a306b5b35
commit
c29e204c9f
8 changed files with 209 additions and 348 deletions
|
@ -1,6 +1,7 @@
|
|||
import * as core from "@actions/core";
|
||||
|
||||
import { Outputs, RefKey, State } from "../constants";
|
||||
import * as cache from "@actions/cache";
|
||||
|
||||
export function isGhes(): boolean {
|
||||
const ghUrl = new URL(
|
||||
|
@ -74,3 +75,21 @@ export function getInputAsInt(
|
|||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
export function isCacheFeatureAvailable(): boolean {
|
||||
if (!cache.isFeatureAvailable()) {
|
||||
if (isGhes()){
|
||||
logWarning(
|
||||
"Cache action is only supported on GHES version >= 3.5. If you are on version >=3.5 Please check with GHES admin if ArtifactCache service is enabled or not."
|
||||
);
|
||||
}
|
||||
else{
|
||||
logWarning(
|
||||
"An internal error has occurred in cache backend. Please check https://www.githubstatus.com/ for any ongoing issue in actions."
|
||||
);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue