Made an interface that represents Action parameter

This commit is contained in:
Kir_Antipov 2023-02-16 13:37:18 +00:00
parent 7780bda3f1
commit e55d6ffbda

View file

@ -0,0 +1,43 @@
/**
* Represents an input or output parameter of a GitHub Action.
*/
export interface ActionParameter {
/**
* A string description of the parameter.
*/
description: string;
/**
* A name of the parameter this one's value should be redirected to.
*
* @custom
*/
redirect?: string;
/**
* The data type of the parameter.
*
* @custom
*/
type?: string;
/**
* Whether this parameter should be included in the groups by default.
*
* Defaults to `false`.
*
* @custom
*/
unique?: boolean;
}
/**
* Normalizes the name of a parameter by replacing spaces with underscores and converting it to uppercase.
*
* @param name - The name of the parameter to normalize.
*
* @returns The normalized name of the parameter.
*/
export function normalizeActionParameterName(name: string): string {
return name.replaceAll(" ", "_").toUpperCase();
}