I've setup an outgoing webhook for my Slack team that listens to all messages on a channel and parses them for metadata that I might use to trigger further actions. It all works fine except for messages from bots.
I've added the travis-ci integration which works great but when the webhook posts that bot's message data to my external endpoint the text field is empty. Here's an example dump of the post data I'm getting back in that case:
Array
(
[token] => xxx
[team_id] => xxx
[team_domain] => xxx
[service_id] => xxx
[channel_id] => xxx
[channel_name] => builds
[timestamp] => 1468073807.000103
[user_id] => USLACKBOT
[user_name] => slackbot
[text] => <-- no text here...
[bot_id] => xxx
[bot_name] =>
)
So my question is, have I setup something wrong or missed a setting to allow that text to be included, is it a bug, or is that expected behavior? I don't see anything in the documentation about it. The If the answer is I can't do anything to get the travis-ci bot's text, does anyone have any ideas on how to work with bot messages in an automated way?
The real problem I'm trying to solve is triggering deployments based on the travis-ci build status, but I haven't been successful because you can't customize the payload for webhooks in github or travis-ci (or slack) and I don't want to expose any authentication details in a deployment script for travis-ci to execute. And Slack seems like a very convenient intermediary that I can keep building off of, but I just started learning about the integrations.
I have not looked into encrypted environment variables in travis-ci yet because I'd like to manage this with webhooks and apis rather than adding an extra custom script in my repo unless that's not possible.
I have no problem with looking at another approach though, the "deployment" I'm trying to trigger is just a Docker Hub build.