Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 31, 2019. It is now read-only.

Commit d06ceae

Browse files
author
Matt Hicks
committed
Added backchat.rb for Backchat.io
1 parent 8529ab2 commit d06ceae

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

services/backchat.rb

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
class Service::BackchatIO < Service
2+
string :branches
3+
4+
def receive_push
5+
branches = data['branches'].to_s.split(/\s+/)
6+
ref = payload["ref"].to_s
7+
return unless branches.empty? || branches.include?(ref.split("/").last)
8+
9+
http.headers['Content-Type'] = 'application/json'
10+
11+
res = http_post "https://URL_HERE/changesets/github",
12+
JSON.generate(payload)
13+
14+
if res.status < 200 || res.status > 299
15+
raise_config_error
16+
end
17+
end
18+
end

0 commit comments

Comments
 (0)