Fixed GitHub Action run numbers

This commit is contained in:
rtm516 2023-05-27 14:05:41 +01:00 committed by GitHub
parent 277396525f
commit f2d83c4ed1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -97,7 +97,7 @@ configure<BlossomExtension> {
}
fun Project.buildNumber(): Int =
System.getenv("BUILD_NUMBER")?.let { Integer.parseInt(it) } ?: -1
(System.getenv("GITHUB_RUN_NUMBER") ?: jenkinsBuildNumber())?.let { Integer.parseInt(it) } ?: -1
inner class GitInfo {
val branch: String
@ -129,3 +129,6 @@ inner class GitInfo {
repository = git?.repository?.config?.getString("remote", "origin", "url") ?: ""
}
}
// todo remove this when we're not using Jenkins anymore
private fun jenkinsBuildNumber(): String? = System.getenv("BUILD_NUMBER")