@@ -202,6 +202,7 @@ import org.kohsuke.github.GitHub
202202
203203task github (dependsOn : build) {
204204 def repoIdProvider = providers. gradleProperty(" mcx_repo_id" )
205+ def ghVersion = getGhVersion()
205206
206207 onlyIf {
207208 ENV . GITHUB_TOKEN
@@ -211,7 +212,6 @@ task github(dependsOn: build) {
211212 def github = GitHub . connectUsingOAuth(ENV . GITHUB_TOKEN as String )
212213 def repoId = repoIdProvider. get()
213214 def repository = github. getRepository(repoId)
214- def ghVersion = getGhVersion()
215215
216216 def ghRelease = repository. getReleaseByTagName(ghVersion as String )
217217 if (ghRelease == null ) {
@@ -235,6 +235,7 @@ task closeMilestone {
235235 def minecraftVersionProvider = providers. gradleProperty(" minecraft_version" )
236236 def modLoaderProvider = providers. gradleProperty(" mod_loader" )
237237 def archivesBaseNameProvider = providers. gradleProperty(" archives_base_name" )
238+ def ghVersion = getGhVersion()
238239
239240 onlyIf {
240241 ENV . GITHUB_TOKEN
@@ -244,7 +245,6 @@ task closeMilestone {
244245 def github = GitHub . connectUsingOAuth(ENV . GITHUB_TOKEN as String )
245246 def repoId = repoIdProvider. get()
246247 def repository = github. getRepository(repoId)
247- def ghVersion = getGhVersion()
248248
249249 // Weird API design: listMilestones() requires GHIssueState while everything else uses GHMilestoneState.
250250 def milestone = repository. listMilestones(GHIssueState . ALL ). find { it. title == ghVersion }
@@ -263,13 +263,13 @@ task closeMilestone {
263263
264264task uploadBackups {
265265 dependsOn build
266+ def shortVersion = getGhVersion(). substring(1 )
266267
267268 onlyIf {
268269 ENV . WI_BACKUPS_API_KEY
269270 }
270271
271272 doLast {
272- def shortVersion = getGhVersion(). substring(1 )
273273 def backupUrl = " https://api.wurstclient.net/artifact-backups/Wurst/${ shortVersion} "
274274
275275 def maxRetries = 3
0 commit comments