Skip to content

Commit 0dcd66c

Browse files
pmrotuleCodex-
authored andcommitted
fix: allow all possible workflow input types
1 parent 0f1ab23 commit 0dcd66c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ inputs:
2424
description: Workflow to return an ID for. Can be the ID or the workflow filename.
2525
required: true
2626
workflow_inputs:
27-
description: A flat JSON object, only supports strings (as per workflow inputs API).
27+
description: A flat JSON object, only supports strings, numbers, and booleans (as per workflow inputs API).
2828
workflow_timeout_seconds:
2929
description: Time until giving up waiting for the start of the workflow run.
3030
default: 300

src/action.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ export interface ActionConfig {
4343
}
4444

4545
interface ActionWorkflowInputs {
46-
[input: string]: string;
46+
[input: string]: string | number | boolean;
4747
}
4848

4949
export enum ActionOutputs {
@@ -93,9 +93,9 @@ function getWorkflowInputs(
9393
const parsedJson = JSON.parse(workflowInputs);
9494
for (const key of Object.keys(parsedJson)) {
9595
const type = typeof parsedJson[key];
96-
if (type !== "string") {
96+
if (!["string", "number", "boolean"].includes(type)) {
9797
throw new Error(
98-
`Expected values to be strings, ${key} value is ${type}`,
98+
`Expected value to be string, number, or boolean. "${key}" value is ${type}`,
9999
);
100100
}
101101
}

0 commit comments

Comments
 (0)