-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathlabels.js
More file actions
40 lines (30 loc) · 768 Bytes
/
labels.js
File metadata and controls
40 lines (30 loc) · 768 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
40
/*
# Labels features
## Setup
```javascript
const GitHubClient = require('../libs/GitHubClient.js').GitHubClient;
const labels = require('../libs/features/labels');
let githubCli = new GitHubClient({
baseUri: "http://github.at.home/api/v3",
token: process.env.TOKEN_GHITHUB_ENTERPRISE
}, labels); //<-- add labels features
```
*/
/*
## createLabel
- parameter: `name, color, owner, repository`
- return: `Promise`
### Description
`createLabel` creates a label for a repository
*/
function createLabel({name, color, owner, repository}) {
return this.postData({path:`/repos/${owner}/${repository}/labels`, data:{
name: name,
color: color
}}).then(response => {
return response.data;
});
}
module.exports = {
createLabel: createLabel
};