Skip to content

Commit fe2682e

Browse files
wangyb-AAlex Wang
andauthored
chore: Add slack notification github action (#459)
*Issue #, if available:* *Description of changes:* - Add slack notification github action. - The secret key has been set up. By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice. Co-authored-by: Alex Wang <wangyb@amazon.com>
1 parent b33d17c commit fe2682e

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

.github/workflows/notify_slack.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: Slack Notifications
2+
3+
on:
4+
issues:
5+
types: [opened, reopened]
6+
pull_request_target:
7+
types: [opened, reopened]
8+
9+
permissions: {}
10+
11+
jobs:
12+
notify:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Send issue notification to Slack
16+
if: github.event_name == 'issues'
17+
uses: slackapi/slack-github-action@v2.1.1
18+
with:
19+
webhook: ${{ secrets.SLACK_WEBHOOK_URL_ISSUE }}
20+
webhook-type: incoming-webhook
21+
payload: |
22+
{
23+
"action": "${{ github.event.action }}",
24+
"issue_url": "${{ github.event.issue.html_url }}",
25+
"package_name": "${{ github.repository }}"
26+
}
27+
28+
- name: Send pull request notification to Slack
29+
if: github.event_name == 'pull_request_target'
30+
uses: slackapi/slack-github-action@v2.1.1
31+
with:
32+
webhook: ${{ secrets.SLACK_WEBHOOK_URL_PR }}
33+
webhook-type: incoming-webhook
34+
payload: |
35+
{
36+
"action": "${{ github.event.action }}",
37+
"pr_url": "${{ github.event.pull_request.html_url }}",
38+
"package_name": "${{ github.repository }}"
39+
}

0 commit comments

Comments
 (0)