Skip to content

Instantly share code, notes, and snippets.

@kiichi
Last active November 30, 2020 14:49
Show Gist options
  • Save kiichi/6fb2d18555cb4cb37c77 to your computer and use it in GitHub Desktop.
Save kiichi/6fb2d18555cb4cb37c77 to your computer and use it in GitHub Desktop.
post-commit svn hook for slack
#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)
@JackLidge
Copy link

Super simple example and explanation of how to do this! Thanks, helped me a lot when trying to implement this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment