-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathpullrequests.js
More file actions
39 lines (29 loc) · 827 Bytes
/
pullrequests.js
File metadata and controls
39 lines (29 loc) · 827 Bytes
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
/*
# Pull Requests features
## Setup
```javascript
const GitHubClient = require('../libs/GitHubClient.js').GitHubClient;
const pullrequests = require('../libs/features/pullrequests');
let githubCli = new GitHubClient({
baseUri: "http://github.at.home/api/v3",
token: process.env.TOKEN_GHITHUB_ENTERPRISE
}, pullrequests); //<-- add pullrequests features
```
*/
/*
## createPullRequest
- parameter: `title, body, head, base, owner, repository`
- return: `Promise`
### Description
`createPullRequest` creates a PR
*/
function createPullRequest({title, body, head, base, owner, repository}) {
return this.postData({path:`/repos/${owner}/${repository}/pulls`, data:{
title, body, head, base
}}).then(response => {
return response.data;
});
}
module.exports = {
createPullRequest: createPullRequest
};