Skip to content

Commit 3e6fd5a

Browse files
authored
feat(library): add 'number' as input type of WorkflowDispatch (#1790)
Technically a breaking change for anyone that relies on enum's exhaustiveness, but I think such usage is highly unlikely.
1 parent 50dbba1 commit 3e6fd5a

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

github-workflows-kt/api/github-workflows-kt.api

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1863,6 +1863,7 @@ public final class io/github/typesafegithub/workflows/domain/triggers/WorkflowDi
18631863
public static final field Choice Lio/github/typesafegithub/workflows/domain/triggers/WorkflowDispatch$Type;
18641864
public static final field Companion Lio/github/typesafegithub/workflows/domain/triggers/WorkflowDispatch$Type$Companion;
18651865
public static final field Environment Lio/github/typesafegithub/workflows/domain/triggers/WorkflowDispatch$Type;
1866+
public static final field Number Lio/github/typesafegithub/workflows/domain/triggers/WorkflowDispatch$Type;
18661867
public static final field String Lio/github/typesafegithub/workflows/domain/triggers/WorkflowDispatch$Type;
18671868
public static fun getEntries ()Lkotlin/enums/EnumEntries;
18681869
public static fun valueOf (Ljava/lang/String;)Lio/github/typesafegithub/workflows/domain/triggers/WorkflowDispatch$Type;

github-workflows-kt/src/main/kotlin/io/github/typesafegithub/workflows/domain/triggers/WorkflowDispatch.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ public data class WorkflowDispatch(
2121
@SerialName("boolean")
2222
Boolean,
2323

24+
@SerialName("number")
25+
Number,
26+
2427
@SerialName("string")
2528
String,
2629
}

github-workflows-kt/src/test/kotlin/io/github/typesafegithub/workflows/yaml/TriggersToYamlTest.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ class TriggersToYamlTest :
6868
type = WorkflowDispatch.Type.Boolean,
6969
required = false,
7070
),
71+
"retries" to
72+
WorkflowDispatch.Input(
73+
description = "Number of retries",
74+
type = WorkflowDispatch.Type.Number,
75+
required = false,
76+
),
7177
"environment" to
7278
WorkflowDispatch.Input(
7379
description = "Environment to run tests against",
@@ -108,6 +114,12 @@ class TriggersToYamlTest :
108114
"type" to "boolean",
109115
"required" to false,
110116
),
117+
"retries" to
118+
mapOf(
119+
"description" to "Number of retries",
120+
"type" to "number",
121+
"required" to false,
122+
),
111123
"environment" to
112124
mapOf(
113125
"description" to "Environment to run tests against",

0 commit comments

Comments
 (0)