-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
AddAndCommitV9.kt
262 lines (243 loc) · 10.1 KB
/
AddAndCommitV9.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
// This file was generated using action-binding-generator. Don't change it by hand, otherwise your
// changes will be overwritten with the next binding code regeneration.
// See https://github.com/typesafegithub/github-workflows-kt for more info.
@file:Suppress(
"DataClassPrivateConstructor",
"UNUSED_PARAMETER",
)
package io.github.typesafegithub.workflows.actions.endbug
import io.github.typesafegithub.workflows.domain.actions.Action
import io.github.typesafegithub.workflows.domain.actions.RegularAction
import java.util.LinkedHashMap
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.Map
import kotlin.collections.toList
import kotlin.collections.toTypedArray
/**
* Action: Add & Commit
*
* Automatically commit changes made in your workflow run directly to your repo
*
* [Action on GitHub](https://github.com/EndBug/add-and-commit)
*
* @param add Arguments for the git add command
* @param authorName The name of the user that will be displayed as the author of the commit
* @param authorEmail The email of the user that will be displayed as the author of the commit
* @param commit Additional arguments for the git commit command
* @param committerName The name of the custom committer you want to use
* @param committerEmail The email of the custom committer you want to use
* @param cwd The directory where your repository is located. You should use actions/checkout first
* to set it up
* @param defaultAuthor How the action should fill missing author name or email.
* @param fetch Arguments for the git fetch command (if 'false', the action won't fetch the repo)
* @param message The message for the commit
* @param newBranch The name of the branch to create.
* @param pathspecErrorHandling The way the action should handle pathspec errors from the add and
* remove commands.
* @param pull Arguments for the git pull command. By default, the action does not pull.
* @param push Whether to push the commit and, if any, its tags to the repo. It can also be used to
* set the git push arguments (more info in the README)
* @param remove Arguments for the git rm command
* @param tag Arguments for the git tag command (the tag name always needs to be the first word not
* preceded by a hyphen)
* @param tagPush Arguments for the git push --tags command (any additional argument will be added
* after --tags)
* @param githubToken The token used to make requests to the GitHub API. It's NOT used to make
* commits and should not be changed.
* @param _customInputs Type-unsafe map where you can put any inputs that are not yet supported by
* the binding
* @param _customVersion Allows overriding action's version, for example to use a specific minor
* version, or a newer version that the binding doesn't yet know about
*/
public data class AddAndCommitV9 private constructor(
/**
* Arguments for the git add command
*/
public val add: String? = null,
/**
* The name of the user that will be displayed as the author of the commit
*/
public val authorName: String? = null,
/**
* The email of the user that will be displayed as the author of the commit
*/
public val authorEmail: String? = null,
/**
* Additional arguments for the git commit command
*/
public val commit: String? = null,
/**
* The name of the custom committer you want to use
*/
public val committerName: String? = null,
/**
* The email of the custom committer you want to use
*/
public val committerEmail: String? = null,
/**
* The directory where your repository is located. You should use actions/checkout first to set
* it up
*/
public val cwd: String? = null,
/**
* How the action should fill missing author name or email.
*/
public val defaultAuthor: AddAndCommitV9.DefaultAuthor? = null,
/**
* Arguments for the git fetch command (if 'false', the action won't fetch the repo)
*/
public val fetch: String? = null,
/**
* The message for the commit
*/
public val message: String? = null,
/**
* The name of the branch to create.
*/
public val newBranch: String? = null,
/**
* The way the action should handle pathspec errors from the add and remove commands.
*/
public val pathspecErrorHandling: AddAndCommitV9.PathspecErrorHandling? = null,
/**
* Arguments for the git pull command. By default, the action does not pull.
*/
public val pull: String? = null,
/**
* Whether to push the commit and, if any, its tags to the repo. It can also be used to set the
* git push arguments (more info in the README)
*/
public val push: String? = null,
/**
* Arguments for the git rm command
*/
public val remove: String? = null,
/**
* Arguments for the git tag command (the tag name always needs to be the first word not
* preceded by a hyphen)
*/
public val tag: String? = null,
/**
* Arguments for the git push --tags command (any additional argument will be added
* after --tags)
*/
public val tagPush: String? = null,
/**
* The token used to make requests to the GitHub API. It's NOT used to make commits and should
* not be changed.
*/
public val githubToken: String? = null,
/**
* Type-unsafe map where you can put any inputs that are not yet supported by the binding
*/
public val _customInputs: Map<String, String> = mapOf(),
/**
* Allows overriding action's version, for example to use a specific minor version, or a newer
* version that the binding doesn't yet know about
*/
public val _customVersion: String? = null,
) : RegularAction<AddAndCommitV9.Outputs>("EndBug", "add-and-commit", _customVersion ?: "v9") {
public constructor(
vararg pleaseUseNamedArguments: Unit,
add: String? = null,
authorName: String? = null,
authorEmail: String? = null,
commit: String? = null,
committerName: String? = null,
committerEmail: String? = null,
cwd: String? = null,
defaultAuthor: AddAndCommitV9.DefaultAuthor? = null,
fetch: String? = null,
message: String? = null,
newBranch: String? = null,
pathspecErrorHandling: AddAndCommitV9.PathspecErrorHandling? = null,
pull: String? = null,
push: String? = null,
remove: String? = null,
tag: String? = null,
tagPush: String? = null,
githubToken: String? = null,
_customInputs: Map<String, String> = mapOf(),
_customVersion: String? = null,
) : this(add=add, authorName=authorName, authorEmail=authorEmail, commit=commit,
committerName=committerName, committerEmail=committerEmail, cwd=cwd,
defaultAuthor=defaultAuthor, fetch=fetch, message=message, newBranch=newBranch,
pathspecErrorHandling=pathspecErrorHandling, pull=pull, push=push, remove=remove,
tag=tag, tagPush=tagPush, githubToken=githubToken, _customInputs=_customInputs,
_customVersion=_customVersion)
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
add?.let { "add" to it },
authorName?.let { "author_name" to it },
authorEmail?.let { "author_email" to it },
commit?.let { "commit" to it },
committerName?.let { "committer_name" to it },
committerEmail?.let { "committer_email" to it },
cwd?.let { "cwd" to it },
defaultAuthor?.let { "default_author" to it.stringValue },
fetch?.let { "fetch" to it },
message?.let { "message" to it },
newBranch?.let { "new_branch" to it },
pathspecErrorHandling?.let { "pathspec_error_handling" to it.stringValue },
pull?.let { "pull" to it },
push?.let { "push" to it },
remove?.let { "remove" to it },
tag?.let { "tag" to it },
tagPush?.let { "tag_push" to it },
githubToken?.let { "github_token" to it },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
override fun buildOutputObject(stepId: String): Outputs = Outputs(stepId)
public sealed class DefaultAuthor(
public val stringValue: String,
) {
public object GithubActor : AddAndCommitV9.DefaultAuthor("github_actor")
public object UserInfo : AddAndCommitV9.DefaultAuthor("user_info")
public object GithubActions : AddAndCommitV9.DefaultAuthor("github_actions")
public class Custom(
customStringValue: String,
) : AddAndCommitV9.DefaultAuthor(customStringValue)
}
public sealed class PathspecErrorHandling(
public val stringValue: String,
) {
public object Ignore : AddAndCommitV9.PathspecErrorHandling("ignore")
public object ExitImmediately : AddAndCommitV9.PathspecErrorHandling("exitImmediately")
public object ExitAtEnd : AddAndCommitV9.PathspecErrorHandling("exitAtEnd")
public class Custom(
customStringValue: String,
) : AddAndCommitV9.PathspecErrorHandling(customStringValue)
}
public class Outputs(
stepId: String,
) : Action.Outputs(stepId) {
/**
* Whether the action has created a commit.
*/
public val committed: String = "steps.$stepId.outputs.committed"
/**
* The complete SHA of the commit that has been created.
*/
public val commitLongSha: String = "steps.$stepId.outputs.commit_long_sha"
/**
* The short SHA of the commit that has been created.
*/
public val commitSha: String = "steps.$stepId.outputs.commit_sha"
/**
* Whether the action has pushed to the remote.
*/
public val pushed: String = "steps.$stepId.outputs.pushed"
/**
* Whether the action has created a tag.
*/
public val tagged: String = "steps.$stepId.outputs.tagged"
/**
* Whether the action has pushed a tag.
*/
public val tagPushed: String = "steps.$stepId.outputs.tag_pushed"
}
}