mirror of
https://github.com/trympet/nextcloud-artifacts-action.git
synced 2025-04-25 04:26:08 +02:00
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import * as core from '@actions/core';
|
|
import { NoFileOption } from './NoFileOption';
|
|
|
|
export class Inputs {
|
|
static get ArtifactName(): string {
|
|
return core.getInput("name");
|
|
}
|
|
|
|
static get ArtifactPath(): string {
|
|
return core.getInput("path");
|
|
}
|
|
|
|
static get Retention(): string {
|
|
return core.getInput("retention-days");
|
|
}
|
|
|
|
static get Endpoint(): string {
|
|
return core.getInput("nextcloud-url");
|
|
}
|
|
|
|
static get Username(): string {
|
|
return core.getInput("nextcloud-username");
|
|
}
|
|
|
|
static get Password(): string {
|
|
return core.getInput("nextcloud-password");
|
|
}
|
|
|
|
static get NoFileBehvaior(): NoFileOption {
|
|
const notFoundAction = core.getInput("if-no-files-found") || NoFileOption.warn;
|
|
const noFileBehavior: NoFileOption = NoFileOption[notFoundAction as keyof typeof NoFileOption];
|
|
|
|
if (!noFileBehavior) {
|
|
core.setFailed(
|
|
`Unrecognized ${"ifNoFilesFound"} input. Provided: ${notFoundAction}. Available options: ${Object.keys(
|
|
NoFileOption
|
|
)}`
|
|
);
|
|
}
|
|
|
|
return noFileBehavior;
|
|
}
|
|
}
|