Open nathos opened 9 years ago
@nathos: https://github.com/github/platform-samples/pull/97 would be a start (contains a script that lists all repos of an org). If we decided to include groovy examples, I can also add the code to add them all to a team
Example with node api (https://github.com/octokit/rest.js/)
const orga = 'your-orga';
const repos = await this.githubApi.repos.listForOrg({ org: orga });
for(let repo of repos.data) {
try {
console.log(`Adding: ${repo.name}`);
this.githubApi.teams.addOrUpdateRepo({
team_id: 860,
owner: orga,
repo: repo.name,
permission: "push"
});
} catch (e) {
console.error(e.message);
}
}
Or how about just making the interface for adding repositories better than one repository at a time, 4 clicks/keystroke per repository? This UI is ridiculous!
I made it less painful utilizing gh
(make sure you use token with sufficient permissions)
https://gist.github.com/narze/2c2e141f03daea2c23fc5795107d41d4
It would be useful to have a script that:
Alternatively, it might be better to allow the user to specify a list of repos instead, passing it to the command.