mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-07 07:55:16 +02:00
chore: add github action to cascade github annoucements to slack community
This commit is contained in:
parent
c7e75819f4
commit
e282dfcf02
1 changed files with 41 additions and 0 deletions
41
.github/workflows/slack-announcements.yml
vendored
Normal file
41
.github/workflows/slack-announcements.yml
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
name: Post Announcements to Slack
|
||||
|
||||
on:
|
||||
discussion:
|
||||
types: [created, edited]
|
||||
|
||||
jobs:
|
||||
notify-slack:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check if announcement
|
||||
id: check
|
||||
run: |
|
||||
# GitHub API check to verify it's in announcements category
|
||||
|
||||
- name: Post to Slack
|
||||
if: steps.check.outputs.is_announcement == 'true'
|
||||
uses: slackapi/slack-github-action@v1
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"text": "New Announcement: ${{ github.event.discussion.title }}",
|
||||
"blocks": [
|
||||
{
|
||||
"type": "section",
|
||||
"text": {
|
||||
"type": "mrkdwn",
|
||||
"text": "*${{ github.event.discussion.title }}*\n${{ github.event.discussion.body }}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "section",
|
||||
"text": {
|
||||
"type": "mrkdwn",
|
||||
"text": "<${{ github.event.discussion.html_url }}|View Discussion>"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_DOGRAH_COMMUNITY_WEBHOOK_URL }}
|
||||
Loading…
Add table
Add a link
Reference in a new issue