Skip to content

Commit bf13d79

Browse files
committed
Fix wait input
1 parent 29c721f commit bf13d79

File tree

4 files changed

+14
-3
lines changed

4 files changed

+14
-3
lines changed

action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ inputs:
2020
upstream-input-name:
2121
description: Name of upstream input
2222
wait:
23+
default: "false"
2324
description: Whether to wait for
2425
outputs:
2526
conclusion:

workflow-dispatch/dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29744,7 +29744,7 @@ async function main() {
2974429744
const ref = coreExports.getInput("ref") || context.ref;
2974529745
const inputs = getJsonInput("inputs");
2974629746
const upstreamInputName = coreExports.getInput("upstream-input-name");
29747-
const wait = coreExports.getBooleanInput("wait");
29747+
const wait = coreExports.getInput("wait");
2974829748
const upstreamUrl = currentUrl();
2974929749
if (upstreamInputName) {
2975029750
inputs[upstreamInputName] = upstreamUrl;

workflow-dispatch/src/action.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@ export const extraGithubContext = {
55
runAttempt: +process.env.GITHUB_RUN_ATTEMPT!,
66
};
77

8+
export function getBooleanInput(name: string) {
9+
const text = getInput(name);
10+
switch (text) {
11+
case "false":
12+
return false;
13+
case "true":
14+
return true;
15+
}
16+
setFailed(`Invalid boolean for ${name}`);
17+
}
18+
819
export function getJsonInput(name: string) {
920
const text = getInput(name);
1021
try {

workflow-dispatch/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
error,
3-
getBooleanInput,
43
getInput,
54
info,
65
setFailed,
@@ -24,7 +23,7 @@ async function main() {
2423
const ref = getInput("ref") || context.ref;
2524
const inputs = getJsonInput("inputs");
2625
const upstreamInputName = getInput("upstream-input-name");
27-
const wait = getBooleanInput("wait");
26+
const wait = getInput("wait");
2827

2928
const upstreamUrl = currentUrl();
3029
if (upstreamInputName) {

0 commit comments

Comments
 (0)