-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgithub.yml
64 lines (50 loc) · 1.36 KB
/
github.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# See README.md in this directory
- init:
- name: Read secret tokens
readfile:
yaml: "tokens.yml"
register: tokens
- name: Incoming github request
pipe:
- name: Github Webhook endpoint
match:
string: =In.URL.Path
value: /github
- name: must be HTTP POST
match:
string: =In.Method
value: POST
- name: Get body
body:
mime: application/json
type: string
register: body
- name: Check GitHub hash
header:
name: X-Hub-Signature-256
value: '="sha256=" + hmacSha256(R.tokens.content.github, R.body.payload)'
- name: Parse JSON body
body:
type: json
register: body
- header:
name: X-GitHub-Event
register: event
- default:
http: # pushbullet push API
url: https://api.pushbullet.com/v2/pushes
method: post
headers:
Access-Token: =R.tokens.content.pushbullet
match: # match event name per default
string: '=R.event.value'
chromecast: # Used to give voice notifications
# Google Home IP addr
addr: 192.168.3.9
# Credentials to use Google API service for TTS
google_service_account: "path_to/google_service_account.json"
- log:
msg: '= "event received: " + R.event.value'
- include: "ping_event.yml"
- include: "push_event.yml"
- include: "pull_request_event.yml"