-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
UpdateGradleWrapperActionV1.kt
174 lines (162 loc) · 7.53 KB
/
UpdateGradleWrapperActionV1.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
// 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.gradleupdate
import io.github.typesafegithub.workflows.domain.actions.Action
import io.github.typesafegithub.workflows.domain.actions.RegularAction
import java.util.LinkedHashMap
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
import kotlin.collections.List
import kotlin.collections.Map
import kotlin.collections.toList
import kotlin.collections.toTypedArray
/**
* Action: Update Gradle Wrapper Action
*
* Keeps Gradle Wrapper script in your projects up-to-date
*
* [Action on GitHub](https://github.com/gradle-update/update-gradle-wrapper-action)
*
* @param repoToken Access token for the repository, e.g. `{{ secrets.GITHUB_TOKEN }}`.
* @param reviewers List of users to request a review from (comma or newline-separated).
* @param teamReviewers List of teams to request a review from (comma or newline-separated).
* @param labels List of labels to set on the Pull Request (comma or newline-separated).
* @param baseBranch Base branch where the action will run and update the Gradle Wrapper.
* @param targetBranch Branch to create the Pull Request against.
* @param setDistributionChecksum Whether to set the `distributionSha256Sum` property in
* `gradle-wrapper.properties`.
* @param paths List of paths where to search for Gradle Wrapper files (comma or newline-separated).
* @param pathsIgnore List of paths to be excluded when searching for Gradle Wrapper files (comma or
* newline-separated).
* @param releaseChannel Gradle release channel to be used (either `stable` or `release-candidate`).
* @param mergeMethod Which merge method to use for auto-merge (either `MERGE`, `REBASE`, or
* `SQUASH`). If unset, auto-merge will not be enabled on opened PRs.
* @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 UpdateGradleWrapperActionV1 private constructor(
/**
* Access token for the repository, e.g. `{{ secrets.GITHUB_TOKEN }}`.
*/
public val repoToken: String? = null,
/**
* List of users to request a review from (comma or newline-separated).
*/
public val reviewers: List<String>? = null,
/**
* List of teams to request a review from (comma or newline-separated).
*/
public val teamReviewers: List<String>? = null,
/**
* List of labels to set on the Pull Request (comma or newline-separated).
*/
public val labels: List<String>? = null,
/**
* Base branch where the action will run and update the Gradle Wrapper.
*/
public val baseBranch: String? = null,
/**
* Branch to create the Pull Request against.
*/
public val targetBranch: String? = null,
/**
* Whether to set the `distributionSha256Sum` property in `gradle-wrapper.properties`.
*/
public val setDistributionChecksum: Boolean? = null,
/**
* List of paths where to search for Gradle Wrapper files (comma or newline-separated).
*/
public val paths: List<String>? = null,
/**
* List of paths to be excluded when searching for Gradle Wrapper files (comma or
* newline-separated).
*/
public val pathsIgnore: List<String>? = null,
/**
* Gradle release channel to be used (either `stable` or `release-candidate`).
*/
public val releaseChannel: UpdateGradleWrapperActionV1.ReleaseChannel? = null,
/**
* Which merge method to use for auto-merge (either `MERGE`, `REBASE`, or `SQUASH`). If unset,
* auto-merge will not be enabled on opened PRs.
*/
public val mergeMethod: UpdateGradleWrapperActionV1.MergeMethod? = 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<Action.Outputs>("gradle-update", "update-gradle-wrapper-action", _customVersion ?:
"v1") {
public constructor(
vararg pleaseUseNamedArguments: Unit,
repoToken: String? = null,
reviewers: List<String>? = null,
teamReviewers: List<String>? = null,
labels: List<String>? = null,
baseBranch: String? = null,
targetBranch: String? = null,
setDistributionChecksum: Boolean? = null,
paths: List<String>? = null,
pathsIgnore: List<String>? = null,
releaseChannel: UpdateGradleWrapperActionV1.ReleaseChannel? = null,
mergeMethod: UpdateGradleWrapperActionV1.MergeMethod? = null,
_customInputs: Map<String, String> = mapOf(),
_customVersion: String? = null,
) : this(repoToken=repoToken, reviewers=reviewers, teamReviewers=teamReviewers, labels=labels,
baseBranch=baseBranch, targetBranch=targetBranch,
setDistributionChecksum=setDistributionChecksum, paths=paths, pathsIgnore=pathsIgnore,
releaseChannel=releaseChannel, mergeMethod=mergeMethod, _customInputs=_customInputs,
_customVersion=_customVersion)
@Suppress("SpreadOperator")
override fun toYamlArguments(): LinkedHashMap<String, String> = linkedMapOf(
*listOfNotNull(
repoToken?.let { "repo-token" to it },
reviewers?.let { "reviewers" to it.joinToString(",") },
teamReviewers?.let { "team-reviewers" to it.joinToString(",") },
labels?.let { "labels" to it.joinToString(",") },
baseBranch?.let { "base-branch" to it },
targetBranch?.let { "target-branch" to it },
setDistributionChecksum?.let { "set-distribution-checksum" to it.toString() },
paths?.let { "paths" to it.joinToString(",") },
pathsIgnore?.let { "paths-ignore" to it.joinToString(",") },
releaseChannel?.let { "release-channel" to it.stringValue },
mergeMethod?.let { "merge-method" to it.stringValue },
*_customInputs.toList().toTypedArray(),
).toTypedArray()
)
override fun buildOutputObject(stepId: String): Action.Outputs = Outputs(stepId)
public sealed class ReleaseChannel(
public val stringValue: String,
) {
public object Stable : UpdateGradleWrapperActionV1.ReleaseChannel("stable")
public object ReleaseCandidate :
UpdateGradleWrapperActionV1.ReleaseChannel("release-candidate")
public class Custom(
customStringValue: String,
) : UpdateGradleWrapperActionV1.ReleaseChannel(customStringValue)
}
public sealed class MergeMethod(
public val stringValue: String,
) {
public object Merge : UpdateGradleWrapperActionV1.MergeMethod("MERGE")
public object Rebase : UpdateGradleWrapperActionV1.MergeMethod("REBASE")
public object Squash : UpdateGradleWrapperActionV1.MergeMethod("SQUASH")
public class Custom(
customStringValue: String,
) : UpdateGradleWrapperActionV1.MergeMethod(customStringValue)
}
}