Skip to content

Commit

Permalink
Fix getCommitTimestamp (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikRehmTT committed Sep 4, 2024
1 parent 4c4bd09 commit 5ccb41b
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions vars/pipeline2ATX.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -398,13 +398,8 @@ def findNonPassedVerdict(steps, accumulatedTime) {
def getCommitTimestamp() {
def commitTimestamp = 0.0
try {
def process = ["git", "-C", env.WORKSPACE, "show", "-s", "--format=%ct", env.GIT_COMMIT].execute()
def output = new StringBuffer()
def error = new StringBuffer()
process.consumeProcessOutput(output, error)
process.waitFor()
println(output.toString())
if (process.exitValue() == 0) {
def process = ["git", "-C", env.WORKSPACE, "show", "-s", "--format=%ct", env.GIT_COMMIT].execute().text
if (process) {
commitTimestamp = output.toString().trim().toLong()
println(commitTimestamp)
}
Expand Down

0 comments on commit 5ccb41b

Please sign in to comment.