SVNSlackNotifier is a lightweight, dependency-free .NET console app to send VisualSVN Server commit notifications to Slack.
- .NET Framework 4.5+ (uses
HttpClient
) - If using the
-url
parameter, it currently expects the new HTML5 browser in VisualSVN Server 3.2.0+
- If you haven't already, add a new "Incoming WebHooks" integration in your Slack account.
- Copy the
.exe
and.config
files from the latest Release into a folder of your choosing that is accessible from your svn server. - Edit the
.config
file and replace the appSettings keySlackWebhookURL
with the Webhook URL found in your Slack integration setup.
To let SVNSlackNotifier know about commits, we need to edit the post-commit
hook in your svn repo. For each repository you'd like notifying to Slack...
- Open VisualSVN Server Manager and right-click on the repository. Click Properties in the context menu.
- On the "Hooks" tab, highlight the "Post-commit hook" option and click "Edit".
- In the field, enter the path to your
SVNSlackNotifier.exe
executable along with any parameters (see below) you would like. Parameters-path
and-rev
are required. The more parameters you provide, the better the output into Slack. An example might look like:
"C:\SVNSlackNotifier\SVNSlackNotifier.exe" -path=%1 -rev=%2 -name=TestRepo -url=http://scswinvm:8080/svn/TestRepo
-path
(required) - The physical path to the repository. This is provided by thepost-commit
hook as%1
.-rev
(required) - The revision number of the commit. This is provided by thepost-commit
hook as%2
.-name
(optional) - The name of the repository. If provided, the repo name will appear in the Slack notification.-url
(optional) - The URL of the repository. If provided, the revision number will be linked to the commit page.-channel
(optional) - The Slack channel in which to post the notification. If provided, this will override the choice in your Slack integration setup and post to this channel instead. Format must be#channelname
(for channel) or@username
(for a DM).
- A log file
SVNSlackNotifier.log
will be written to the executable's folder if any errors occur. Check there first to see what's up. - Ensure you have replaced the app setting
SlackWebhookURL
in the.config
file with your actual URL given by Slack when you setup your integration. - Ensure that the
.config
file's app settingsvnlookPath
is correct for your installation. The app usessvnlook
to lookup more details about the commit such as the author name and commit message.
- Thanks to the guys at VisualSVN for permission to use their logo for this little integration.