Skip to content

Commit 0c9be3f

Browse files
add support access token for github sync (#217)
1 parent 5ce7d63 commit 0c9be3f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

lib/interface/cli/commands/team/synchronize.cmd.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@ const command = new Command({
1818
alias: 't',
1919
required: true,
2020
})
21-
.example('codefresh synchronize teams [clientName] -t [clientType]', 'Synchronize team with group');
21+
.option('access-token', {
22+
describe: 'Access token (for github personal access token)',
23+
alias: 'tk',
24+
required: false,
25+
})
26+
.example('codefresh synchronize teams [clientName] -t [clientType] -tk [accessToken]', 'Synchronize team with group');
2227
},
2328
handler: async (argv) => {
24-
console.log(JSON.stringify(await team.synchronizeClientWithGroup(argv['client-name'], argv.t), null, 2));
29+
console.log(JSON.stringify(await team.synchronizeClientWithGroup(argv['client-name'], argv.t, argv['access-token']), null, 2));
2530
},
2631
});
2732

lib/logic/api/team.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ const removeUserFromTeam = async (teamId, userId) => {
7575
return sendHttpRequest(options);
7676
};
7777

78-
const synchronizeClientWithGroup = async (clientName, clientType) => {
78+
const synchronizeClientWithGroup = async (clientName, clientType, accessToken) => {
7979
const options = {
80-
url: `/api/team/group/synchronize/name/${clientName}/type/${clientType}`,
80+
url: `/api/team/group/synchronize/name/${clientName}/type/${clientType}?access_token=${accessToken}`,
8181
method: 'GET',
8282
};
8383

0 commit comments

Comments
 (0)