generate build summary

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2024-05-02 13:49:01 +02:00
parent e51051ad0b
commit d880b1964b
No known key found for this signature in database
GPG key ID: ADE44D8C9D44FBE4
3 changed files with 34 additions and 2 deletions

View file

@ -79,6 +79,25 @@ export async function getInputs(): Promise<Inputs> {
};
}
export function sanitizeInputs(inputs: Inputs) {
const res = {};
for (const key of Object.keys(inputs)) {
if (key === 'github-token') {
continue;
}
const value: string | string[] | boolean = inputs[key];
if (typeof value === 'boolean' && value === false) {
continue;
} else if (Array.isArray(value) && value.length === 0) {
continue;
} else if (!value) {
continue;
}
res[key] = value;
}
return res;
}
export async function getArgs(inputs: Inputs, toolkit: Toolkit): Promise<Array<string>> {
const context = handlebars.compile(inputs.context)({
defaultContext: Context.gitContext()