Skip to content

Slack send message

Slack send message #22

name: Slack send message
on:
workflow_dispatch:
inputs:
channel-or-user:
description: 'Send a message to a channel or a user (prefer usage of id instead of name).'
# C02J5M4JMK7 is a test channel
# vars.SLACK_CHANNEL_ID_NOTIFICATIONS is the production channel
default: 'C02J5M4JMK7'
type: string
required: true
jobs:
send:
runs-on: ${{ vars.RUNNER_UBUNTU }}
env:
SLACK_CHANNEL: ${{ inputs.channel-or-user }} // sanitize user inputs
steps:
- name: Send message to Slack
uses: slackapi/[email protected]
with:
method: chat.postMessage
token: ${{ secrets.SLACK_BOT_TOKEN }}
payload: |
channel: ${{ env.SLACK_CHANNEL }}
text: "This is a test from the ${{github.repository}} repository"
# blocks:
# - type: "section"
# text:
# type: "mrkdwn"
# text: ":mega: This is a test from the ${{github.repository}} repository"
# emoji: true
# {
# "blocks": [
# {
# "type": "header",
# "text": {
# "type": "plain_text",
# "text": ":mega: This is a test from the ${{github.repository}} repository",
# "emoji": true
# }
# },
# {
# "type": "divider"
# },
# {
# "type": "section",
# "text": {
# "type": "mrkdwn",
# "text": "- available <https://github.com/${{github.repository}}/releases|Releases> :heavy_check_mark: \n - Check packages published on <https://www.npmjs.com/package/bpmn-visualization|NPM> :heavy_check_mark:"
# }
# },
# {
# "type": "divider"
# },
# {
# "type": "section",
# "text": {
# "type": "mrkdwn",
# "text": "See the next steps <https://github.com/${{github.repository}}/blob/master/docs/contributors/maintainers.md#github-issues-milestones-and-projects-update|here> :arrow_left:"
# }
# }
# ]
# }