fix(build): allow detached git HEAD
This commit is contained in:
parent
7c2a422094
commit
297ced7a2a
2 changed files with 3 additions and 4 deletions
3
.github/workflows/build.yml
vendored
3
.github/workflows/build.yml
vendored
|
|
@ -29,5 +29,4 @@ jobs:
|
|||
with:
|
||||
name: app
|
||||
if-no-files-found: error
|
||||
path: |
|
||||
app/build/outputs/apk/debug/app-debug.apk
|
||||
path: app/build/outputs/apk/debug/app-debug.apk
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ plugins {
|
|||
alias(libs.plugins.kotlin.serialization)
|
||||
}
|
||||
|
||||
val gitCurrentBranch = providers.execIgnoreCode("git", "symbolic-ref", "--short", "HEAD")
|
||||
val gitCurrentBranch = providers.execIgnoreCode("git", "symbolic-ref", "--quiet", "--short", "HEAD").takeIf { it.isNotEmpty() }
|
||||
val gitLatestCommit = providers.execIgnoreCode("git", "rev-parse", "--short", "HEAD")
|
||||
val gitHasLocalCommits = providers.execIgnoreCode("git", "log", "origin/$gitCurrentBranch..HEAD").isNotEmpty()
|
||||
val gitHasLocalCommits = gitCurrentBranch?.let { providers.execIgnoreCode("git", "log", "origin/$gitCurrentBranch..HEAD").isNotEmpty() } ?: false
|
||||
val gitHasHasLocalChanges = providers.execIgnoreCode("git", "status", "-s").isNotEmpty()
|
||||
|
||||
android {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue