Skip to content

Conversation

kl4w
Copy link
Contributor

@kl4w kl4w commented May 16, 2022

  • remove the message assert as it fails when using interpolation, eg message:
SLACK_MESSAGE: "External API ${{CF_BRANCH}} release completed: g.codefresh.io/build/${{CF_BUILD_ID}}"
  • Add SLACK_ATTACHMENTS variable

Copy link
Contributor

@lrochette lrochette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The default value for IMAGE_VERSION needs to match the step version so 0.0.7

@kl4w kl4w requested a review from lrochette May 16, 2022 21:13
Copy link
Contributor

@lrochette lrochette left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works as expected
You can add this attachment example if you want at line 33 of step.yaml
- description: example-with-attachment workflow: sendSlack: type: slack-post-channel arguments: SLACK_TOKEN: xxxxxx SLACK_CHANNEL: channel1 SLACK_MESSAGE: message SLACK_ATTACHMENTS: > [ { "blocks": [ { "type": "section", "text": { "type": "mrkdwn", "text": "Danny Torrence left the following review for your property:" } }, { "type": "section", "block_id": "section567", "text": { "type": "mrkdwn", "text": "<https://example.com|Overlook Hotel> \n :star: \n Doors had too many axe holes, guest in room 237 was far too rowdy, whole place felt stuck in the 1920s." }, "accessory": { "type": "image", "image_url": "https://is5-ssl.mzstatic.com/image/thumb/Purple3/v4/d3/72/5c/d3725c8f-c642-5d69-1904-aa36e4297885/source/256x256bb.jpg", "alt_text": "Haunted hotel image" } }, { "type": "section", "block_id": "section789", "fields": [ { "type": "mrkdwn", "text": "*Average Rating*\n1.0" } ] } ] } ]

@lrochette lrochette merged commit d23a436 into codefresh-io:master May 17, 2022
@kl4w kl4w deleted the kash/slack-post-channel branch May 17, 2022 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants