Giter Club home page Giter Club logo

github-repo-sync's Introduction

GitHub Repo Sync

Synchronize GitHub repositories from a set scheme accross an organization. This is based on the github-label-maker

Installation

Clone this repository with

git clone https://github.com/xljones/github-repo-sync.git

Then, install the requirements with

cd github-repo-sync && python -m pip install -r requirements.txt

Usage

usage: python -m github_repo_sync [-h] -t TOKEN [-r REPOS] [-l LABELS] [-e]
                                  [-d] [-v]



optional arguments:
  -h, --help            show this help message and exit

required arguments:
  -t TOKEN, --token TOKEN
                        GitHub personal access token. Generated here:
                        https://github.com/settings/tokens

optional arguments:
  -r REPOS, --repos REPOS
                        GitHub repository scheme. A JSON list of "owner" and
                        "repository" bundled keys
  -l LABELS, --labels LABELS
                        GitHub label scheme. A JSON list of "aliases" (list),
                        "name", "description", and "color" bundled keys
  -e, --execute         Execute the changes (adding new labels and editing
                        labels only). Without this only a dry-run happens
  -d, --delete          Deletes any repo label that is not associated with the
                        scheme, and has not associated open issues or PRs.
                        This needs to be used in conjunction with -e/--execute
  -v, --verbose         Turn on verbose logging
  • The default repository scheme is located in schemes/repos/default.json, but you can force a different repo scheme with the -r flag.
  • The default labelling scheme is located in schemes/labels/default.json, but you can force a different label scheme with the -l flag.

Examples

To view the outputs that would be made in a dry-run, using the default schemes.

python -m github_repo_sync -t TOKEN

To execute the changes (addition of labels, editing of labels, but not deletion of labels)

python -m github_repo_sync -t TOKEN -e

To execute the changes, as above, but including deletion of labels

python -m github_repo_sync -t TOKEN -e -d

Troubleshooting

  • If you see โš ๏ธ Error [updating|deleting|adding] label: {'message': 'Not Found', 'documentation_url': 'https://developer.github.com/v3/issues/labels/#update-a-label'} [status code: 404], it's likely that your authentication token has permission to view the repository and labels, but not to update, add, or delete them.

  • If you see ModuleNotFoundError: No module named 'github', make sure you've installed the requirements prior to running this script. See Requirements.

github-repo-sync's People

Contributors

xljones avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.