1
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-06-19 11:20:23 +02:00

Rename option to lookup-only

This commit is contained in:
Marc Mueller 2023-01-18 12:21:26 +01:00
parent d1960e64f9
commit 2ef4e0621f
16 changed files with 68 additions and 68 deletions

View file

@ -4,7 +4,7 @@ export enum Inputs {
RestoreKeys = "restore-keys", // Input for cache, restore action
UploadChunkSize = "upload-chunk-size", // Input for cache, save action
EnableCrossOsArchive = "enableCrossOsArchive", // Input for cache, restore, save action
DryRun = "dry-run" // Input for cache, restore action
LookupOnly = "lookup-only" // Input for cache, restore action
}
export enum Outputs {

View file

@ -34,13 +34,13 @@ async function restoreImpl(
const enableCrossOsArchive = utils.getInputAsBool(
Inputs.EnableCrossOsArchive
);
const dryRun = utils.getInputAsBool(Inputs.DryRun);
const lookupOnly = utils.getInputAsBool(Inputs.LookupOnly);
const cacheKey = await cache.restoreCache(
cachePaths,
primaryKey,
restoreKeys,
{ dryRun: dryRun },
{ lookupOnly: lookupOnly },
enableCrossOsArchive
);

View file

@ -14,7 +14,7 @@ interface CacheInput {
key: string;
restoreKeys?: string[];
enableCrossOsArchive?: boolean;
dryRun?: boolean;
lookupOnly?: boolean;
}
export function setInputs(input: CacheInput): void {
@ -27,8 +27,8 @@ export function setInputs(input: CacheInput): void {
Inputs.EnableCrossOsArchive,
input.enableCrossOsArchive.toString()
);
input.dryRun !== undefined &&
setInput(Inputs.DryRun, input.dryRun.toString());
input.lookupOnly !== undefined &&
setInput(Inputs.LookupOnly, input.lookupOnly.toString());
}
export function clearInputs(): void {
@ -37,5 +37,5 @@ export function clearInputs(): void {
delete process.env[getInputName(Inputs.RestoreKeys)];
delete process.env[getInputName(Inputs.UploadChunkSize)];
delete process.env[getInputName(Inputs.EnableCrossOsArchive)];
delete process.env[getInputName(Inputs.DryRun)];
delete process.env[getInputName(Inputs.LookupOnly)];
}