-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (39 loc) · 1.39 KB
/
issue_created.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
44
name: issue_created
on:
issues:
types: [opened]
env:
issue_title: ${{ github.event.issue.title }}
jobs:
send-issue-created-slack-message:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
- name: Setup jq
run: sudo apt-get install jq
- name: Send Slack Notification on Github Issue Opened
run: |
LABELS=$(echo '${{ toJson(github.event.issue.labels.*.name) }}' | jq -r 'join(", ")')
curl -X POST -H 'Content-type: application/json' \
--data "{
\"text\": \"Issue Created\",
\"blocks\": [
{
\"type\": \"section\",
\"text\": {
\"type\": \"mrkdwn\",
\"text\": \"<!channel> *New Github Issue*\"
}
},
{
\"type\": \"section\",
\"text\": {
\"type\": \"mrkdwn\",
\"text\": \"*Issue Creator:* ${{ github.event.issue.user.login }}\n*Issue Title:* $issue_title\n*Issue URL:* ${{ github.event.issue.html_url }}\n*Issue Labels:* $LABELS\"
}
}
]
}" \
${{ secrets.SLACK_WEBHOOK_ISSUES }}
shell: bash