feat: utilize GitHub Actions Utilities package (#406)

* feat: utilize GitHub Actions Utilities package

* test: modify get action context test by mocking `getInput` function
This commit is contained in:
Alfi Maulana
2024-08-08 15:29:56 +07:00
committed by GitHub
parent d1c539d005
commit 571e81560b
6 changed files with 86 additions and 77 deletions

View File

@@ -1,3 +1,4 @@
import { getInput } from "gha-utils";
import path from "node:path";
export interface Context {
@@ -14,16 +15,6 @@ export interface Context {
};
}
/**
* Retrieves an action input.
* @param key - The key of the action input.
* @returns The action input value as a string.
*/
function getInput(key: string): string {
const value = process.env[`INPUT_${key.toUpperCase()}`] || "";
return value.trim();
}
export function getContext(): Context {
const sourceDir = getInput("source-dir");
const options: string[] = [];