Skip to content

Commit

Permalink
Track versions for sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
sschr15 committed Oct 5, 2023
1 parent b4c6ab4 commit a911904
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ tasks {
attributes(
"Main-Class" to "org.quiltmc.community.AppKt"
)

if (System.getenv("GITHUB_SHA") != null) {
attributes(
"Implementation-Version" to System.getenv("GITHUB_SHA")
)
}
}
}
}
5 changes: 5 additions & 0 deletions src/main/kotlin/org/quiltmc/community/_Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,17 @@ suspend fun ExtensibleBotBuilder.common() {
extensions {
sentry {
val sentryDsn = envOrNull("SENTRY_DSN")
val version: String? = object {}::class.java.`package`.implementationVersion

if (sentryDsn != null) {
enable = true

dsn = sentryDsn
}

if (version != null) {
release = version
}
}

help {
Expand Down

0 comments on commit a911904

Please sign in to comment.