From 2e8d6bcc9f38bdc83dcb5be36178faed94f27081 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Fri, 11 Aug 2023 16:26:17 +1000 Subject: [PATCH] Include link to commit in autopublished changelog --- build-logic/src/main/kotlin/extensions.kt | 2 +- universal/build.gradle.kts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/build-logic/src/main/kotlin/extensions.kt b/build-logic/src/main/kotlin/extensions.kt index 765412e0..fecd6ed9 100644 --- a/build-logic/src/main/kotlin/extensions.kt +++ b/build-logic/src/main/kotlin/extensions.kt @@ -38,7 +38,7 @@ fun Project.latestCommitHash(): String { return byteOut.toString(Charsets.UTF_8.name()).trim() } -fun Project.lastCommitMessage(): String { +fun Project.latestCommitMessage(): String { val byteOut = ByteArrayOutputStream() exec { commandLine = listOf("git", "log", "-1", "--pretty=%B") diff --git a/universal/build.gradle.kts b/universal/build.gradle.kts index 9e2a9369..e44aff35 100644 --- a/universal/build.gradle.kts +++ b/universal/build.gradle.kts @@ -50,7 +50,8 @@ val suffixedVersion = if (isRelease) baseVersion else baseVersion + "+" + System val changelogContent = if (isRelease) { "See [GitHub](https://github.com/ViaVersion/ViaBackwards) for release notes." } else { - rootProject.lastCommitMessage() + val commitHash = rootProject.latestCommitHash() + "[$commitHash](https://github.com/ViaVersion/ViaBackwards/commit/$commitHash) ${rootProject.latestCommitMessage()}" } val isMainBranch = branch == "master" modrinth {