From aa0e1808f25e5e8b1a76f34c29f2eeb7db75a7c7 Mon Sep 17 00:00:00 2001 From: Nat Morris Date: Thu, 9 Nov 2017 22:14:37 +0000 Subject: feature: Slack hook - optionally disable diff snippets and post custom messages (#763) * continue to diffs by default, but optionally post formatted messages * updated readme * remove static channel name * Update Hooks.md --- docs/Hooks.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'docs') diff --git a/docs/Hooks.md b/docs/Hooks.md index bf6ea54..ca99034 100644 --- a/docs/Hooks.md +++ b/docs/Hooks.md @@ -140,6 +140,19 @@ hooks: channel: "#network-changes" ``` +Optionally you can disable snippets and post a formatted message, for instance linking to a commit in a git repo. Named parameters `%{node}`, `%{group}`, `%{model}` and `%{commitref}` are available. + +``` yaml +hooks: + slack: + type: slackdiff + events: [post_store] + token: SLACK_BOT_TOKEN + channel: "#network-changes" + diff: false + message: "%{node} %{group} %{model} updated https://git.intranet/network-changes/commit/%{commitref}" +``` + Note the channel name must be in quotes. ## Hook type: xmppdiff -- cgit v1.2.1