mirror of
https://github.com/darksaid98/HuskHomes.git
synced 2026-12-04 06:28:49 +00:00
[ci-skip] Detect tagged commit heads in versionMetadata()
This commit is contained in:
1 parent
2899a08c76
commit
081a77a6e9
1 file changed
+7
@@ -105,6 +105,13 @@ logger.lifecycle("Building HuskHomes ${version} by William278")
|
|||||||
|
|
||||||
@SuppressWarnings('GrMethodMayBeStatic')
|
@SuppressWarnings('GrMethodMayBeStatic')
|
||||||
def versionMetadata() {
|
def versionMetadata() {
|
||||||
|
// Get if there is a tag for this commit
|
||||||
|
def tag = grgit.tag.list().find { it.commit.id == grgit.head().id }
|
||||||
|
if (tag != null) {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
|
||||||
|
// Otherwise, get the last commit hash and if it's a clean head
|
||||||
if (grgit == null) {
|
if (grgit == null) {
|
||||||
return System.getenv("GITHUB_RUN_NUMBER") ? 'build.' + System.getenv("GITHUB_RUN_NUMBER") : 'unknown'
|
return System.getenv("GITHUB_RUN_NUMBER") ? 'build.' + System.getenv("GITHUB_RUN_NUMBER") : 'unknown'
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user