1
0
Fork 0
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:
Sindri Guðmundsson 2021-11-04 09:45:24 +00:00 committed by Davíð Guðni
parent 611465405c
commit df46e813e6
6 changed files with 30 additions and 2 deletions

View file

@ -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"

View file

@ -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"

View file

@ -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);
}