How can I trigger a notification only when a branch is merged?
I have a notification configured only to fire for a certain branch, however it seems that pull requests against that branch also trigger the notification. Is it possible to only send the notification when the pull request is merged?
Config Excerpt:
branches:
only:
- development
notifications:
- provider: Slack
incoming_webhook: https://hooks.slack.com/services/xxxxxxxxxxx
on_build_success: true
on_build_failure: false
template: >-
{{#jobs}}
{{#artifacts}}
<{{url}}|Build {{buildVersion}}>
{{/artifacts}}
{{/jobs}}
<{{buildUrl}}|Appveyor> <{{commitUrl}}|Github></code>
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
1 Posted by Ilya Finkelshte... on 18 Mar, 2019 07:27 PM
Hi Burke,
We have no option to filter notification by PR. But what you can do is instead of built-in notification write a simple script based on slack REST API (sample) and run it only if
APPVEYOR_PULL_REQUEST_TITLE
environment variable is not setAND
APPVEYOR_REPO_BRANCH
isdevelopment
. Run iton_finish
Something like this:
For Slack notification script you can also use environment variables. And sure use secure variable for Slack token.
Ilya.
2 Posted by burke livingsto... on 19 Mar, 2019 07:14 AM
Hi Ilya,
This was very helpful. Thank you for your quick reply.
Ilya Finkelshteyn closed this discussion on 19 Mar, 2019 04:59 PM.