gha-utils
Version:
A minimalistic utility package for developing GitHub Actions
83 lines (82 loc) • 3.14 kB
TypeScript
/**
* @internal
* Retrieves the value of an environment variable.
*
* @param name - The name of the environment variable.
* @returns The value of the environment variable.
* @throws Error if the environment variable is not defined.
*/
export declare function mustGetEnvironment(name: string): string;
/**
* Retrieves the value of a GitHub Actions input.
*
* @param name - The name of the GitHub Actions input.
* @returns The value of the GitHub Actions input, or an empty string if not found.
*/
export declare function getInput(name: string): string;
/**
* Sets the value of a GitHub Actions output.
*
* @param name - The name of the GitHub Actions output.
* @param value - The value to set for the GitHub Actions output.
* @returns A promise that resolves when the value is successfully set.
*/
export declare function setOutput(name: string, value: string): Promise<void>;
/**
* Sets the value of a GitHub Actions output synchronously.
*
* @param name - The name of the GitHub Actions output.
* @param value - The value to set for the GitHub Actions output.
*/
export declare function setOutputSync(name: string, value: string): void;
/**
* Retrieves the value of a GitHub Actions state.
*
* @param name - The name of the GitHub Actions state.
* @returns The value of the GitHub Actions state, or an empty string if not found.
*/
export declare function getState(name: string): string;
/**
* Sets the value of a GitHub Actions state.
*
* @param name - The name of the GitHub Actions state.
* @param value - The value to set for the GitHub Actions state.
* @returns A promise that resolves when the value is successfully set.
*/
export declare function setState(name: string, value: string): Promise<void>;
/**
* Sets the value of a GitHub Actions state synchronously.
*
* @param name - The name of the GitHub Actions state.
* @param value - The value to set for the GitHub Actions state.
*/
export declare function setStateSync(name: string, value: string): void;
/**
* Sets the value of an environment variable in GitHub Actions.
*
* @param name - The name of the environment variable.
* @param value - The value to set for the environment variable.
* @returns A promise that resolves when the environment variable is
* successfully set.
*/
export declare function setEnv(name: string, value: string): Promise<void>;
/**
* Sets the value of an environment variable in GitHub Actions synchronously.
*
* @param name - The name of the environment variable.
* @param value - The value to set for the environment variable.
*/
export declare function setEnvSync(name: string, value: string): void;
/**
* Adds a system path to the environment in GitHub Actions.
*
* @param sysPath - The system path to add to the environment.
* @returns A promise that resolves when the system path is successfully added.
*/
export declare function addPath(sysPath: string): Promise<void>;
/**
* Adds a system path to the environment in GitHub Actions synchronously.
*
* @param sysPath - The system path to add to the environment.
*/
export declare function addPathSync(sysPath: string): void;