mirror of
https://github.com/actions/cache.git
synced 2025-07-18 09:37:54 +00:00
Add option to specify URL of cache server
This commit is contained in:
parent
611465405c
commit
df46e813e6
6 changed files with 30 additions and 2 deletions
|
@ -6,6 +6,7 @@ import * as utils from "./utils/actionUtils";
|
|||
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
utils.setActionsCacheUrl();
|
||||
if (utils.isGhes()) {
|
||||
utils.logWarning(
|
||||
"Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
|
||||
|
|
|
@ -11,6 +11,7 @@ process.on("uncaughtException", e => utils.logWarning(e.message));
|
|||
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
utils.setActionsCacheUrl();
|
||||
if (utils.isGhes()) {
|
||||
utils.logWarning(
|
||||
"Cache action is not supported on GHES. See https://github.com/actions/cache/issues/505 for more details"
|
||||
|
|
|
@ -18,6 +18,13 @@ export function isExactKeyMatch(key: string, cacheKey?: string): boolean {
|
|||
);
|
||||
}
|
||||
|
||||
export function setActionsCacheUrl(): void {
|
||||
const requestedCacheUrl = core.getInput("cache-url");
|
||||
if (requestedCacheUrl) {
|
||||
process.env.ACTIONS_CACHE_URL = requestedCacheUrl;
|
||||
}
|
||||
}
|
||||
|
||||
export function setCacheState(state: string): void {
|
||||
core.saveState(State.CacheMatchedKey, state);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue