-
Notifications
You must be signed in to change notification settings - Fork 0
/
git-api.js
59 lines (53 loc) · 1.26 KB
/
git-api.js
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
"use strict";
var request = require('request');
module.exports = [
function(branch, pull_no) {
request({
url: "https://api.github.com/repos/scrollback/scrollback/issues/" + pull_no + "/comments",
auth: {
"user": "scrollbackbot",
"pass": "wotgiz345"
},
method: "POST",
headers: {
"user-Agent": "scrollbackbot"
},
json: true,
body: {
"body": "Your branch is staged [here](https://" + branch + ".stage.scrollback.io)\n[Run integration tests](https://" +
branch + ".stage.scrollback.io/t/integration)"
}
}, function(error, response) {
if (!error) console.log("response: ", response.body.body);
else {
console.log(error);
}
//console.log("body: ", body);
});
},
function(branch, msg) {
request({
url: "https://api.github.com/repos/scrollback/scrollback/pulls",
auth: {
"user": "scrollbackbot",
"pass": "wotgiz345"
},
method: "POST",
headers: {
"user-Agent": "scrollbackbot"
},
json: true,
body: {
"title": msg + "[auto PR]",
"head": branch,
"base": "master"
}
}, function(error) {
if (!error) console.log("A pull request have been succesfuly created for branch " + branch);
else {
console.log(error);
}
});
}
];
//git log -n 1 --pretty=format:"%H"