0.0.7 • Published 9 years ago

github-team-tools v0.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
9 years ago

GitHub Team Tools v0.0.7

Adds all GitHub organization members & repos into a (read only) team.
Note you need to be a member of the GitHub organizations Owners team to be able to run this.

Usage

npm install

If behind a proxy make sure to export HTTP_PROXY

CLI setup

export GITHUB_TOKEN="your-github-app-token"
export GITHUB_ORG_NAME="my-org"
export GITHUB_TEAM_ID="1234567"

node setup

var GhTeamTools = require('github-team-tools'),
    config = {
      token: process.env.GITHUB_TOKEN,
      orgName: process.env.GITHUB_ORG_NAME,
      readOnlyTeamId: process.env.GITHUB_TEAM_ID,
    };

var ghTeamTools = new GhTeamTools(config),
    dryRun = true;

Add all org repos into a team

CLI

gulp add-repos --dry-run

node

ghTeamTools.addMissingRepos(function () {
    console.log('done');
}, dryRun);

Add a single repo into a team

CLI

gulp add-repo --repo <repo>

node

ghTeamTools.addRepo('<repo>', function () {
    console.log('done');
});

Add all org members into a team

CLI

gulp add-users --dry-run

node

ghTeamTools.addMissingUsers(function () {
    console.log('done');
}, dryRun);

Add a single member into a team

CLI

gulp add-user --user <username>

node

ghTeamTools.addUser('<username>', function () {
    console.log('done');
});

Remove users that are only found in a team

CLI

gulp remove-users --dry-run

node

ghTeamTools.removeUsersOnlyInReadOnly(function () {
    console.log('done');
}, dryRun);

Only remove a user from a team if they are not found in any other teams

CLI

gulp remove-user --user <username>

node

ghTeamTools.removeUserOnlyInReadOnly('<username>', function () {
    console.log('done');
});
0.0.7

9 years ago

0.0.6

9 years ago