-
Notifications
You must be signed in to change notification settings - Fork 5
43 lines (42 loc) · 1.72 KB
/
slack-send-message.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
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:
errors: true
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: "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:"