We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 094fa9f + 960779c commit 7d0fc74Copy full SHA for 7d0fc74
pipeline-examples/gitcommit/gitcommit.groovy
@@ -2,6 +2,4 @@
2
// checked out your sources on the agent. A 'git' executable
3
// must be available.
4
// Most typical, if you're not cloning into a sub directory
5
-gitCommit = sh(returnStdout: true, script: 'git rev-parse HEAD').trim()
6
-// short SHA, possibly better for chat notifications, etc.
7
-shortCommit = gitCommit.take(6)
+shortCommit = sh(returnStdout: true, script: "git log -n 1 --pretty=format:'%h'").trim()
0 commit comments