3
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2025-04-26 21:35:33 +00:00

Adds input for upload chunk size

This commit is contained in:
Dave Hadka 2020-10-02 09:59:55 -05:00
parent d606e039ae
commit a6f1f4b32e
10 changed files with 84 additions and 11 deletions

View file

@ -63,3 +63,14 @@ export function getInputAsArray(
.map(s => s.trim())
.filter(x => x !== "");
}
export function getInputAsInt(
name: string,
options?: core.InputOptions
): number | undefined {
const value = Number(core.getInput(name, options));
if (Number.isNaN(value) || value < 0) {
return undefined;
}
return value;
}

View file

@ -26,4 +26,5 @@ export function clearInputs(): void {
delete process.env[getInputName(Inputs.Path)];
delete process.env[getInputName(Inputs.Key)];
delete process.env[getInputName(Inputs.RestoreKeys)];
delete process.env[getInputName(Inputs.UploadChunkSize)];
}