Created
March 15, 2019 00:10
-
-
Save geunho/b4ec1659610e8b96da589b87c4c1ab9a to your computer and use it in GitHub Desktop.
get all git commiters' email
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 젠킨스 빌드 실패시 모든 커미터에게 메일을 보낼 때 유용한 스크립트. | |
# | |
# 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