Skip to content

Commit 8b37c6d

Browse files
committed
check-run: use Typia for type checking
This not only makes the validation more robust, easier to read (and verify the logic), but also prepares for persisting the parameters in an Action state so that subsequent calls to the Action can update, say, the text, without having to re-specify all of the parameters. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 91da6bd commit 8b37c6d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

lib/ci-helper.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export class CIHelper {
297297
summary: string;
298298
text?: string;
299299
};
300-
detailsURL?: string;
300+
details_url?: string;
301301
conclusion?: ConclusionType;
302302
};
303303
const params = {} as CheckRunParameters;
@@ -317,13 +317,12 @@ export class CIHelper {
317317
.map((name) => [name.replaceAll("-", "_"), core.getInput(name)] as const)
318318
.forEach(([key, value]) => {
319319
if (!value) return;
320-
if (key === "pr-url") Object.assign(params, getPullRequestOrCommentKeyFromURL(value));
321-
else if (key === "check-run-id") params.check_run_id = Number.parseInt(value, 10);
322-
else if (key === "details-url") params.detailsURL = value;
320+
if (key === "pr_url") Object.assign(params, getPullRequestOrCommentKeyFromURL(value));
321+
else if (key === "check_run_id") params.check_run_id = Number.parseInt(value, 10);
323322
else if (key === "title" || key === "summary" || key === "text") {
324323
if (!params.output) Object.assign(params, { output: {} });
325324
(params.output as { [key: string]: string })[key] = value;
326-
} else (params as unknown as { [key: string]: string })[key.replaceAll("-", "_")] = value;
325+
} else (params as unknown as { [key: string]: string })[key] = value;
327326
});
328327
validateCheckRunParameters();
329328

0 commit comments

Comments
 (0)