-
Notifications
You must be signed in to change notification settings - Fork 772
71 lines (65 loc) · 2.1 KB
/
slack.yml
File metadata and controls
71 lines (65 loc) · 2.1 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Slack Notifier
on:
issues:
types:
- opened
- closed
pull_request:
types:
- opened
- closed
permissions:
contents: read
jobs:
on-issue-opened:
runs-on: ubuntu-latest
if: github.event_name == 'issues' && github.event.action == 'opened'
steps:
- name: notify
env:
ISSUE_TITLE: ${{ github.event.issue.title }}
run: |
curl \
-X POST \
-H 'Content-Type: application/json' \
-d '{"type": "issues_opened", "id": "${{ github.event.issue.number }}", "title": "'"$ISSUE_TITLE"'"}' \
${{ secrets.CI_SLACK_WEBHOOK_URL }}
on-issue-closed:
runs-on: ubuntu-latest
if: github.event_name == 'issues' && github.event.action == 'closed'
steps:
- name: notify
env:
ISSUE_TITLE: ${{ github.event.issue.title }}
run: |
curl \
-X POST \
-H 'Content-Type: application/json' \
-d '{"type": "issues_closed", "id": "${{ github.event.issue.number }}", "title": "'"$ISSUE_TITLE"'"}' \
${{ secrets.CI_SLACK_WEBHOOK_URL }}
on-pr-opened:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.action == 'opened'
steps:
- name: notify
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
curl \
-X POST \
-H 'Content-Type: application/json' \
-d '{"type": "pullrequest_opened", "id": "${{ github.event.pull_request.number }}", "title": "'"$PR_TITLE"'"}' \
${{ secrets.CI_SLACK_WEBHOOK_URL }}
on-pr-closed:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && github.event.action == 'closed'
steps:
- name: notify
env:
PR_TITLE: ${{ github.event.pull_request.title }}
run: |
curl \
-X POST \
-H 'Content-Type: application/json' \
-d '{"type": "pullrequest_closed", "id": "${{ github.event.pull_request.number }}", "title": "'"$PR_TITLE"'"}' \
${{ secrets.CI_SLACK_WEBHOOK_URL }}