-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy path05-teams.js
More file actions
53 lines (40 loc) · 1.02 KB
/
05-teams.js
File metadata and controls
53 lines (40 loc) · 1.02 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
/**
* Teams
*/
const GitHubClient = require('../libs/GitHubClient.js').GitHubClient;
const teams = require('../libs/features/teams');
let githubCli = new GitHubClient({
baseUri:"http://github.at.home/api/v3",
token:process.env.TOKEN_GHITHUB_ENTERPRISE
}, teams);
githubCli.createTeam({
org: 'ZeiraCorp',
name: 'DreamTeam',
description: 'the dream team',
repo_names:[
'ZeiraCorp/toys',
'ZeiraCorp/tools'
],
privacy: 'closed',
permission:'admin'
}).then(team => {
console.log(team)
// Add members to team of an organization
githubCli.addTeamMembership({
teamId: team.id,
userName: 'spocky',
role: 'maintener'
}).then(results=>console.log(results))
githubCli.addTeamMembership({
teamId: team.id,
userName: 'jeanlouc',
role: 'maintener'
}).then(results=>console.log(results))
githubCli.addTeamMembership({
teamId: team.id,
userName: 'k33g',
role: 'maintener'
}).then(results=>console.log(results))
}).catch(error => {
console.log("error", error)
});