forked from JetBrains/writerside-github-action
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 2.09 KB
/
Copy pathslack-message.yml
File metadata and controls
56 lines (53 loc) · 2.09 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
name: 'Send Slack notification'
on:
issue_comment:
types: [created]
issues:
types: [opened]
workflow_dispatch:
jobs:
send-slack-notification:
runs-on: ubuntu-latest
steps:
- name: GitHub issue commented
id: slack-comment
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
payload: |
{
"text": "GitHub issue commented",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":github: User _${{ github.event.comment.user.login }}_ commented issue:\n><${{ github.event.issue.html_url }}|*${{ github.event.issue.title }}*> \n>${{ github.event.comment.body }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
if: github.event_name == 'issue_comment' && !(github.event.comment.user.login == 'Muph0' || github.event.comment.user.login == 'lananovikova10' || github.event.comment.user.login == 'siarb')
- name: GitHub issue submitted
id: slack-opened
uses: slackapi/slack-github-action@v1.26.0
with:
channel-id: ${{ secrets.SLACK_CHANNEL_ID }}
payload: |
{
"text": "GitHub issue submitted",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":github: User _${{ github.event.issue.user.login }}_ submitted issue:\n><${{ github.event.issue.html_url }}|*${{ github.event.issue.title }}*> \n>${{ github.event.issue.body }}"
}
}
]
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
if: github.event_name == 'issues' && github.event.action == 'opened' && !(github.event.issue.user.login == 'Muph0' || github.event.issue.user.login == 'lananovikova10' || github.event.issue.user.login == 'siarb')