Send Slack Message

Action ID: slack:sendMessage:conversation
NPM Package:

@mdude2314/backstage-plugin-scaffolder-backend-module-slack

Description

Sends a Slack message to a specific conversation via the Slack SDK. This requires you to install the application in your workspace and provide a token

Input Schema

PropertyTypeDescriptionRequired
tokenstringThe token to use to authenticate with the Slack API. This is only used if the token is not supplied in the app configuration.
messagestringThe message to send via webhook
conversationIdstringThe ID of the conversation to send the message to. Either this or the conversation name must be specified here or in the app configuration. If both are specified, the conversation ID will be used.
conversationNamestringThe name of the conversation to send the message to. This is only used if the conversation ID is not specified.

Output Schema

No output schema defined for this action.

Usage Examples

Notify a Slack channel after publishing a new service repository

Send a plain text message to a specific Slack conversation once the repository is published. Use this to notify the team channel after fetch:template and publish:github complete.

Copy
steps:
  - id: fetch
    action: fetch:template
    input:
      url: ./skeleton

  - id: publish
    action: publish:github
    input:
      repoUrl: github.com?owner=platform&repo=${{ parameters.component_id }}
      defaultBranch: main
      repoVisibility: private

  - id: notify_slack
    action: slack:sendMessage:conversation
    input:
      token: ${{ secrets.slack_bot_token }}
      conversationId: C012AB3CD
      text: |
        <!channel> New service created: ${{ steps.publish.output.remoteUrl }}
        Owner: ${{ parameters.owner }}
        Requested by: ${{ user.entity.metadata.name }}

Send a rich Slack block message to a specific conversation

Post a structured message using Slack blocks to a conversation ID. Use this to provide clear metadata and links after publish:github.

Copy
steps:
  - id: fetch
    action: fetch:template
    input:
      url: ./skeleton

  - id: publish
    action: publish:github
    input:
      repoUrl: github.com?owner=payments&repo=${{ parameters.component_id }}
      defaultBranch: main
      repoVisibility: internal

  - id: announce_in_slack
    action: slack:sendMessage:conversation
    input:
      token: ${{ secrets.slack_bot_token }}
      conversationId: ${{ parameters.slackConversationId }}
      text: "New component scaffolded"
      blocks:
        - type: header
          text:
            type: plain_text
            text: "Service ${{ parameters.component_id }} scaffolded"
            emoji: false
        - type: section
          fields:
            - type: mrkdwn
              text: "*Repository*\n<${{ steps.publish.output.remoteUrl }}|${{ parameters.component_id }}>"
            - type: mrkdwn
              text: "*Owner*\n${{ parameters.owner }}"
        - type: context
          elements:
            - type: mrkdwn
              text: "Requested by ${{ user.entity.metadata.name }}"

Other actions in @mdude2314/backstage-plugin-scaffolder-backend-module-slack