-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy path08-issues.js
More file actions
76 lines (56 loc) · 1.45 KB
/
08-issues.js
File metadata and controls
76 lines (56 loc) · 1.45 KB
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
65
66
67
68
69
/**
* Issues, comments and reactions
*/
const GitHubClient = require('../libs/GitHubClient.js').GitHubClient;
const issues = require('../libs/features/issues');
let githubCli = new GitHubClient({
baseUri:"http://github.at.home/api/v3",
token:process.env.TOKEN_GHITHUB_ENTERPRISE
}, issues);
let babs = new GitHubClient({
baseUri:"http://github.at.home/api/v3",
token:process.env.TOKEN_GHE_27_BABS
}, issues);
let buster = new GitHubClient({
baseUri:"http://github.at.home/api/v3",
token:process.env.TOKEN_GHE_27_BUSTER
}, issues);
let issueBody=`
## I've got a problem
> this a WIP
:octocat: :heart:
`;
githubCli.createIssue({
title: "Huston?",
body: issueBody,
labels: ["point: 21", "priority: high", "type: bug"],
milestone: 1,
assignees: ["k33g"],
owner: 'ZeiraCorp',
repository: 'toys'
}).then(issue => {
babs.addIssueReaction({
owner: 'ZeiraCorp'
, repository: 'toys'
, number: issue.number
, content: "hooray"
}).then(res => console.log(res))
.catch(err => console.log("err", err))
babs.addIssueComment({
owner: 'ZeiraCorp'
, repository: 'toys'
, number: issue.number
, body: [
"Hey @k33g :wave:!"
, "It's a nice issue"
, ":octocat: :heart:"
].join('\n')
}).then(comment => {
buster.addIssueCommentReaction({
owner: 'ZeiraCorp'
, repository: 'toys'
, id: comment.id
, content: "+1"
})
}).catch(err => console.log("err", err))
});