-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (42 loc) · 1.54 KB
/
webhook.yml
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
name: Call Webhook on Push or PR Merge to Master
on:
push:
branches:
- master
pull_request:
types:
- closed
jobs:
call-webhook:
runs-on: ubuntu-latest
steps:
- name: Call Webhook on Push
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
run: |
curl -X POST http://68.183.144.184:8080/github-webhook/ \
-H "Content-Type: application/json" \
-d '{
"event_type": "push",
"repository": "${{ github.repository }}",
"ref": "${{ github.ref }}",
"commit": "${{ github.sha }}",
"author": "${{ github.actor }}"
}'
- name: Call Webhook on PR Merge
if: github.event_name == 'pull_request' && github.event.pull_request.merged == true && github.ref == 'refs/heads/master'
run: |
curl -X POST http://68.183.144.184:8080/github-webhook/ \
-H "Content-Type: application/json" \
-d '{
"event_type": "pull_request",
"action": "closed",
"repository": "${{ github.repository }}",
"ref": "${{ github.ref }}",
"commit": "${{ github.sha }}",
"author": "${{ github.actor }}",
"pull_request": {
"number": ${{ github.event.pull_request.number }},
"title": "${{ github.event.pull_request.title }}",
"url": "${{ github.event.pull_request.html_url }}"
}
}'