Skip to content

Commit

Permalink
ci: change method getting commit sha
Browse files Browse the repository at this point in the history
  • Loading branch information
xfqwdsj committed Jan 20, 2024
1 parent 7fcd311 commit bd04790
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:
id: build
shell: bash
run: |
./gradlew ciVersioning -Poutput=$GITHUB_OUTPUT
./gradlew ciVersioning
./gradlew ciReleaseApp
- if: github.ref == 'refs/heads/main' && github.event_name == 'push'
Expand Down
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ tasks.register("updateCommitSha") {
doLast {
val stream = ByteArrayOutputStream()
exec {
commandLine("git", "rev-parse", "--short", "main")
commandLine("git", "rev-parse", "--short")
standardOutput = stream
}
commitSha = stream.toString().trim()
Expand Down Expand Up @@ -267,7 +267,7 @@ tasks.register("ciVersioning") {
dependsOn("updateVersion")

doLast {
val outputDir = file(project.property("output").toString())
val outputDir = file(System.getenv("GITHUB_OUTPUT"))
outputDir.writeText("version=${version.substringBefore('+')}")
logger.lifecycle("Wrote version to ${outputDir.absolutePath}")
}
Expand Down

0 comments on commit bd04790

Please sign in to comment.