Skip to content

Commit 2feebd1

Browse files
authored
[INFRA] Create a workflow to test sending message to Slack (#84)
1 parent cdf1faf commit 2feebd1

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Slack send message
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
channel-or-user:
6+
description: 'Send a message to a channel or a user (prefer usage of id instead of name).'
7+
default: 'CSF7TG6N5'
8+
type: string
9+
required: true
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-20.04
14+
steps:
15+
- name: Send message to Slack
16+
uses: slackapi/[email protected]
17+
with:
18+
channel-id: ${{ github.event.inputs.channel-or-user }}
19+
payload: |
20+
{
21+
"blocks": [
22+
{
23+
"type": "header",
24+
"text": {
25+
"type": "plain_text",
26+
"text": ":mega: This is a test from the ${{github.repository}} repository",
27+
"emoji": true
28+
}
29+
},
30+
{
31+
"type": "divider"
32+
},
33+
{
34+
"type": "section",
35+
"text": {
36+
"type": "mrkdwn",
37+
"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:"
38+
}
39+
},
40+
{
41+
"type": "divider"
42+
},
43+
{
44+
"type": "section",
45+
"text": {
46+
"type": "mrkdwn",
47+
"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:"
48+
}
49+
}
50+
]
51+
}
52+
env:
53+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ GitHub pages environment generated by this repository
1414
- [execute job on secrets availability](.github/workflows/execute-depending-on-secrets-availability.yml): use in surge deployments to avoid trying to create deployments for external contributors and dependabot (surge token secret not available)
1515
- [fill github draft releases](.github/workflows/fill-gh-draft-release.yml): experiment the release-drafter configuration (used in bpmn-visualization)
1616
- [Generate Documentation API](.github/workflows/generate-documentation-api.yml): generate a TypeDoc API documentation and push to github-pages (for bpmn-visualization)
17+
- [Slack send message](.github/workflows/slack-send-message.yml): send a message to a Slack channel or user
1718
- [workflow dispatch](.github/workflows/workflow-dispatch.yml): run job depending on if the workflow is triggered from the `master` branch or another branch
1819

1920
### Release simulation

0 commit comments

Comments
 (0)