0.1.5 • Published 5 years ago

github-sync-repos v0.1.5

Weekly downloads
1
License
EPL-2.0
Repository
github
Last release
5 years ago

github-sync-repos

Actions Status

GitHub tools to synchronize milestones or labels across all organization/user repositories.

Prerequisites

Installation

Install from npm registry.

npm install github-sync-repos -g

To upgrade, you can run the above command again.

Usage

To find command help, type gsr -h:

$ gsr -h
Usage: gsr [options] <command> [command-options]

Commands:
  gsr labels <command>        List/add/delete labels of organization or user.
                                                                   [aliases: lb]
  gsr milestones <command>    List/add/delete milestones of a repository.
                                                                   [aliases: ms]
  gsr repositories <command>  List repositories of organization or user.
                                                      [aliases: repos, repo, rp]

GitHub:
  --organization   Github organization name.
  --template-repo  Github template repository name.
  --username, -u   Github account username. Required if API token is empty.
  --password, -p   Github account password. Required if API token is empty.
  --token          Github API token. Required if username is empty.

Options:
  --version      Show version number                                   [boolean]
  --config       Path to JSON config file
  --format       Response format. Available values are: plain, json.
                                                              [default: "plain"]
  --verbose, -v  Show more processing details.        [boolean] [default: false]
  -h, --help     Show help                                             [boolean]

For each command, you can type gsr <command> -h to get more detail help.

Provide GitHub Crendentials

There are several ways to provide command line options. The priority of finding options are (from top to low):

  1. Command line options,
  2. Environment variables on command line,
  3. Environment variables defined in .env file,
  4. Config json file,
  5. Default option value shown in gsr -h.

With Command Line Options

You can use gsr --token <my-api-token> <command> to specify API token in command line.

With Environement Variable

Use GSR_ to prefix your capitalized option name as environment variable name. For example:

$ GSR_TOKEN=<my-api-token> GSR_ORGANIZATION=<my-org-name> GSR_TEMPLATE_REPO=<tpl> gsr ls-repos

If you are using Windows, you will need cross-env. Install with command npm install --g cross-env then you can prefix the above command with cross-env. For example:

$ cross-env GSR_TOKEN=<my-api-token> GSR_ORGANIZATION=<my-org-name> GSR_TEMPLATE_REPO=<tpl> gsr ls-repos

With .env File

You can put GSR_* environment variables into a .env file. Please note, the .env has to be in same folder where you issue gsr command.

For example, create a .env file with this content and put into folder where you usually run your gsr command:

GSR_ORGANIZATION=<my-org>
GSR_TEMPLATE_REPO=<my-tpl-repo>
GSR_TOKEN=<my-api-token>

With config json File

You can create a config json file with key/value of option name/value. For example, create a ~/.config/gsr.json with this content:

{
  "organization": "<my-org>",
  "template-repo": "<my-tpl-repo>",
  "token": "<my-api-token>"
}

Then use this command to use the config file:

$ gsr --config ~/.config/gsr.json [command]
0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago