-
Notifications
You must be signed in to change notification settings - Fork 77
37 lines (33 loc) · 1.05 KB
/
notify-slack.yaml
File metadata and controls
37 lines (33 loc) · 1.05 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
name: Slack Notifications
on:
issues:
types: [opened, reopened, edited]
pull_request_target:
types: [opened, reopened, synchronize]
permissions: {}
jobs:
notify:
runs-on: ubuntu-latest
steps:
- name: Send issue notification to Slack
if: github.event_name == 'issues'
uses: slackapi/slack-github-action@v3.0.2
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL_ISSUE }}
webhook-type: incoming-webhook
payload: |
{
"action": "${{ github.event.action }}",
"issue_url": "${{ github.event.issue.html_url }}"
}
- name: Send pull request notification to Slack
if: github.event_name == 'pull_request_target'
uses: slackapi/slack-github-action@v3.0.2
with:
webhook: ${{ secrets.SLACK_WEBHOOK_URL_PR }}
webhook-type: incoming-webhook
payload: |
{
"action": "${{ github.event.action }}",
"url": "${{ github.event.pull_request.html_url }}"
}