Last active
November 30, 2020 14:49
-
-
Save kiichi/6fb2d18555cb4cb37c77 to your computer and use it in GitHub Desktop.
post-commit svn hook for 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
#this is svn hook script - post-commit by Kiichi | |
#[Instructions] | |
#In slack, create incoming webhook integration, and grab the url | |
#cd /var/svnrepos/hooks | |
#cp post-commit.tpl post-commit | |
#chmod +x post-commit | |
REPOS="$1" | |
REV="$2" | |
SVNTMP="/var/log/svn-post.txt" | |
svnlook info -r $REV $REPOS > $SVNTMP | |
svnlook changed -r $REV $REPOS >> $SVNTMP | |
CHANGES=$(cat $SVNTMP | while read line; do echo -n "$line\\\\n"; done) | |
curl -X POST --data-urlencode 'payload={"channel": "#general", "username": "svn", "text": "'"$CHANGES"'", "icon_emoji": ":heavy_check_mark:"}' (https://hooks.slack.com/services/(YOUR INCOMING SLACK URL) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Super simple example and explanation of how to do this! Thanks, helped me a lot when trying to implement this.