Skip to content

Commit 3af1055

Browse files
authored
Add Slack notifications for PRs and issues (#1456)
Adds a Slack notifier URL workflow (copied from Pytorch connector) ### Does this change impact existing behavior? No ### Does this change need a changelog entry? Does it require a version change? No --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the [Developer Certificate of Origin (DCO)](https://developercertificate.org/). --------- Signed-off-by: Simon Beal <[email protected]>
1 parent 382a369 commit 3af1055

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

.github/workflows/notify_slack.yml

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

0 commit comments

Comments
 (0)