@@ -200,6 +200,7 @@ import org.kohsuke.github.GitHub
200200
201201task github (dependsOn : build) {
202202 def repoIdProvider = providers. gradleProperty(" mcx_repo_id" )
203+ def ghVersion = getGhVersion()
203204
204205 onlyIf {
205206 ENV . GITHUB_TOKEN
@@ -209,7 +210,6 @@ task github(dependsOn: build) {
209210 def github = GitHub . connectUsingOAuth(ENV . GITHUB_TOKEN as String )
210211 def repoId = repoIdProvider. get()
211212 def repository = github. getRepository(repoId)
212- def ghVersion = getGhVersion()
213213
214214 def ghRelease = repository. getReleaseByTagName(ghVersion as String )
215215 if (ghRelease == null ) {
@@ -233,6 +233,7 @@ task closeMilestone {
233233 def minecraftVersionProvider = providers. gradleProperty(" minecraft_version" )
234234 def modLoaderProvider = providers. gradleProperty(" mod_loader" )
235235 def archivesBaseNameProvider = providers. gradleProperty(" archives_base_name" )
236+ def ghVersion = getGhVersion()
236237
237238 onlyIf {
238239 ENV . GITHUB_TOKEN
@@ -242,7 +243,6 @@ task closeMilestone {
242243 def github = GitHub . connectUsingOAuth(ENV . GITHUB_TOKEN as String )
243244 def repoId = repoIdProvider. get()
244245 def repository = github. getRepository(repoId)
245- def ghVersion = getGhVersion()
246246
247247 // Weird API design: listMilestones() requires GHIssueState while everything else uses GHMilestoneState.
248248 def milestone = repository. listMilestones(GHIssueState . ALL ). find { it. title == ghVersion }
@@ -261,13 +261,13 @@ task closeMilestone {
261261
262262task uploadBackups {
263263 dependsOn build
264+ def shortVersion = getGhVersion(). substring(1 )
264265
265266 onlyIf {
266267 ENV . WI_BACKUPS_API_KEY
267268 }
268269
269270 doLast {
270- def shortVersion = getGhVersion(). substring(1 )
271271 def backupUrl = " https://api.wurstclient.net/artifact-backups/Wurst/${ shortVersion} "
272272
273273 def maxRetries = 3
0 commit comments