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.
1 parent 094fa9f commit 960779cCopy full SHA for 960779c
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