Created
April 24, 2015 12:44
-
-
Save sungkwangsong/5cf68301795968ef1c6e to your computer and use it in GitHub Desktop.
git 커밋 내용을 slack으로 보내기
This file contains 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
#!/bin/bash | |
webhookurl="" | |
channel="" | |
username="" | |
text=$(git log -1) | |
message=$(echo "$text" | sed 's/"/\"/g' | sed "s/'/\'/g" | perl -p -e 's/\n/\\n/') | |
json="{\"channel\": \"#$channel\", \"username\":\"$username\", \"text\": \"$message\"}" | |
curl -s -d "payload=$json" $webhookurl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment