refactorsaurusrex
3/10/2017 - 5:24 AM

Jenkinsfile: How to get the author name for the HEAD commit

Jenkinsfile: How to get the author name for the HEAD commit

AUTHOR_NAME = bat (
      script: "git show -s --format='%%an' HEAD",
      returnStdout: true
  ).split('\r\n')[2].trim()

echo "The last commit was written by ${AUTHOR_NAME}."
echo "PS - Jenkins sucks giant monkey balls."