Skip to content

Instantly share code, notes, and snippets.

@geunho
Created March 15, 2019 00:10
Show Gist options
  • Save geunho/b4ec1659610e8b96da589b87c4c1ab9a to your computer and use it in GitHub Desktop.
Save geunho/b4ec1659610e8b96da589b87c4c1ab9a to your computer and use it in GitHub Desktop.
get all git commiters' email
#
# 젠킨스 빌드 실패시 모든 커미터에게 메일을 보낼 때 유용한 스크립트.
#
# Generate environment variables from script
# Useful when jenkins E-mail notification on build failure
#
delemeter=" " # whitespace
commits=$(git log --merges -1 --format=%p)
emails=$(git --no-pager show -s --format=%ae $GIT_COMMIT)
if [ ! -z "$commits" ]
then
for commit in ${commits// / } ; do em=$(git --no-pager show -s --format=%ae $commit); email="$email$delemeter$em"; done
fi
echo "COMMITER_EMAILS=$emails" # [email protected] [email protected]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment