Parse HEAD of current directory and return commit hash
Change-Id: If8d5eae45dc8e60708f93b6e259ae6694b69ba64
diff --git a/src/ci/mcp/Tools.groovy b/src/ci/mcp/Tools.groovy
index 0a1ab62..93f3dd1 100644
--- a/src/ci/mcp/Tools.groovy
+++ b/src/ci/mcp/Tools.groovy
@@ -50,3 +50,14 @@
return constructString(properties, namespace, ";")
}
+
+/**
+ * Parse HEAD of current directory and return commit hash
+ */
+def getGitCommit() {
+ git_commit = sh (
+ script: 'git rev-parse HEAD',
+ returnStdout: true
+ ).trim()
+ return git_commit
+}