Codefresh Steps: Reusable Code for Common Operations
This page provides code you can use to perform common operations in the Codefresh CI/CD platform.
133.4K

Send a Slack message to a channel slack-post-channel

Send a message to a named Slack channel (instead of using a webhook URL)

arguments

  • LOG_LEVEL - Set log level, default info
  • SLACK_ATTACHMENTS - Attachments to send. Documentation https://api.slack.com/docs/message-attachments
  • SLACK_CHANNEL - Name or ID of the channel to send the message to. Use <@ID> or email to send to a user as display names are not unique (https://api.slack.com/changelog/2017-09-the-one-about-usernames).
  • SLACK_IMAGE - The slack-post-channel registry/image for the step.
  • SLACK_IMAGE_VERSION - Version (tag) of the slack-post-channel image to use.
  • SLACK_MESSAGE - The message to send to the channel. Use <@ID> to tag a user. Check https://api.slack.com/reference/surfaces/formatting for details.
  • SLACK_TOKEN - The token to connect to Slack API.
    sendSlack:
  type: slack-post-channel
  arguments:
    SLACK_TOKEN: xxxxxx
    SLACK_CHANNEL: channel1
    SLACK_MESSAGE: message

  
github.com
Laurent Rochette
May 17, 2022