Skip to content

Commit

Permalink
fix: parse ISO 8601 string from git log as a UTC date (#1253)
Browse files Browse the repository at this point in the history
  • Loading branch information
bancey authored Jul 16, 2024
1 parent b6974ad commit f68ebb6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vars/checkoutScm.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def call(params) {
if (scmVars) {
env.GIT_COMMIT = scmVars.GIT_COMMIT
env.GIT_URL = scmVars.GIT_URL
env.LAST_COMMIT_TIMESTAMP = steps.sh(script: "git log -1 --pretty='%cd' --date=iso | tr -d '+[:space:]:-' | head -c 14", returnStdout: true)
env.LAST_COMMIT_TIMESTAMP = steps.sh(script: "git log -1 --pretty='%cd' --date=iso | TZ=UTC date '+%Y%m%d%H%M%S' -f -", returnStdout: true)
}
try {
def credentialsId = SCMSource.SourceByItem.findSource(currentBuild.rawBuild.parent).credentialsId
Expand Down

0 comments on commit f68ebb6

Please sign in to comment.