generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 13
39 lines (35 loc) · 1.14 KB
/
notify_slack.yml
File metadata and controls
39 lines (35 loc) · 1.14 KB
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
name: Slack Notifications
on:
issues:
types: [opened, reopened]
pull_request_target:
types: [opened, reopened]
permissions: {}
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send issue notification to Slack
if: github.event_name == 'issues'
uses: slackapi/slack-github-action@v2.1.1
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL_ISSUE }}
webhook-type: incoming-webhook
payload: |
{
"action": "${{ github.event.action }}",
"issue_url": "${{ github.event.issue.html_url }}",
"package_name": "${{ github.repository }}"
}
- name: Send pull request notification to Slack
if: github.event_name == 'pull_request_target'
uses: slackapi/slack-github-action@v2.1.1
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL_PR }}
webhook-type: incoming-webhook
payload: |
{
"action": "${{ github.event.action }}",
"pr_url": "${{ github.event.pull_request.html_url }}",
"package_name": "${{ github.repository }}"
}