Skip to content

Commit

Permalink
feature: use undefined on empty input
Browse files Browse the repository at this point in the history
  • Loading branch information
Codex- committed Oct 16, 2024
1 parent 530e477 commit 3d82c7a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 18 deletions.
50 changes: 35 additions & 15 deletions dist/index.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export interface ActionConfig {
/**
* Directory in which to run the knip action.
*/
workingDirectory: string;
workingDirectory?: string;
}

export function getConfig(): ActionConfig {
Expand All @@ -48,7 +48,7 @@ export function getConfig(): ActionConfig {
annotations: core.getBooleanInput("annotations", { required: false }),
verbose: core.getBooleanInput("verbose", { required: false }),
ignoreResults: core.getBooleanInput("ignore_results", { required: false }),
workingDirectory: core.getInput("working_directory", { required: false }) || ".",
workingDirectory: core.getInput("working_directory", { required: false }) || undefined,
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/tasks/knip.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ export async function runKnipTasks(
buildScriptName: string,
annotationsEnabled: boolean,
verboseEnabled: boolean,
cwd: string,
cwd?: string,
): Promise<{ sections: string[]; annotations: ItemMeta[] }> {
const taskMs = Date.now();
core.info("- Running Knip tasks");
Expand Down

0 comments on commit 3d82c7a

Please sign in to comment.