-
Notifications
You must be signed in to change notification settings - Fork 212
38 lines (36 loc) · 1.43 KB
/
discussion_ping.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
name: New discussion notification
# ℹ️ https://github.com/WordPress/openverse/blob/main/.github/GITHUB.md#new-discussion-notification
on:
discussion:
types:
- created
jobs:
send_message:
name: Send Slack message
runs-on: ubuntu-latest
env:
discussion_url: ${{ github.event.discussion.html_url }}
discussion_number: ${{ github.event.discussion.number }}
discussion_title: ${{ format('{0}', github.event.discussion.title) }}
discussion_author: ${{ github.event.discussion.user.login }}
discussion_repo: ${{ github.event.repository.full_name }}
steps:
- name: Send notification for new discussion
id: slack
uses: slackapi/slack-github-action@v2
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
webhook-type: incoming-webhook
payload: |
{
"text": "New discussion opened by ${{ env.discussion_author }} in ${{ env.discussion_repo }}: #${{ env.discussion_number }} - ${{ env.discussion_title }}",
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": ":github: New discussion opened by *${{ env.discussion_author }}* in ${{ env.discussion_repo }}:\n<${{ env.discussion_url }}|#${{ env.discussion_number }} - ${{ env.discussion_title }}>"
}
}
]
}