cloudfoundry-community / slack-notification-resource

Concourse CI resource for sending notifications to Slack.
MIT License
75 stars 82 forks source link

Refactored to allow more message flexibility #7

Closed dennisjbell closed 8 years ago

dennisjbell commented 8 years ago

After the last pull request #6, variables in the text file stopped being interpolated, which meant it was no longer able to produce dynamic urls to the build results.

We agree that it is much safer to not trust content coming in from a foreign script, we also need to generate urls based on the pipeline. To this end, we added support for using the text as a template, and provided the environment variable $TEXT_FILE_CONTENT that can be used in that template. See the README.md and examples/* files for details.

In order to be backwards compatible with PR #5, no message will be sent if the text_file is missing, or if found but empty. However, we felt that it was important to always make the best effort to output something rather than fail silently. This way, the end user can be notified that a notification was attempted, but something went wrong (missing file, empty file, etc...). To turn this behaviour on, set the always_notify parameter to 'true'