Open M0nsieurChat opened 5 years ago
Definitely! Is that something you would be interested in working on / submitting a PR for?
Looking at the slack documentation, it seems this "color" is only achievable through attachments : https://api.slack.com/docs/message-attachments
Fortunately, there is an attachments:
parameter so I might be able to reproduce this without altering the container resource.
This works :
on_success:
put: slack-notification
params:
text: "Build ${BUILD_PIPELINE_NAME}/${BUILD_JOB_NAME} #${BUILD_NAME} successful - ${ATC_EXTERNAL_URL}/teams/main/pipelines/${BUILD_PIPELINE_NAME}/jobs/${BUILD_JOB_NAME}/builds/${BUILD_NAME}"
attachments:
- text: "Success !"
color: "#36a64f"
One would want to use the ${text_interpolated}
inside the text:
attribute of the attachment
but this would require some work on the out
bash file : https://github.com/cloudfoundry-community/slack-notification-resource/blob/master/out#L134
Hello !
First of all, thanks for your amazing work !
Would it be possible to introduce a new attribute
color:
so that we could specify which color would be applied to the text notification inside Slack ?I think this is possible because our other slack integrations will apply different colors for different notifications statuses
Doing so could differentiate on_success and on_failure notifications and make more clear which builds failed and which builds succeed
Thanks,