mirror of
https://github.com/threeal/cmake-action.git
synced 2026-02-02 03:50:55 +00:00
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:
@@ -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[] = [];
|
||||
|
||||
Reference in New Issue
Block a user