Giter Site home page Giter Site logo

gh-standardize's Introduction

gh-standardize

A highly customizable Python tool that helps you standardize GitHub repositories. This is mostly useful for organizations who want to maintain a standardized configuration across all repositories. gh-standardize can be started programmatically or from a CLI. All it needs to start is a valid method of authentication, and a config file.

Features:

  • Standardize label names, colors, and descriptions
  • Standardize file locations, and contents
    • Load file contents from URL, or local file
  • Standardize branch protections
  • Repository level configuration for opting out of, or creating custom rules.
  • Make standardization changes on a specific branch, with the option to autmatically create a PR to some other branch.

Requirements:

  • Python 3
  • A GitHub API key (either organization or user)
  • pipenv

Config File Schema

Master Config

The master config file is required.

{
    "PRHEAD": "",
    "PRBASE": "",
    "AUTOMERGE": false,
    "EXEMPT": {
        "REPOS": ["exempt_repo_name"]
    },
    "TEMPLATES": [
        {
            "name": "FILENAME.extension",
            "localPath": "path/to/file.extension",
            "targetPath": "path/to/"
        },
        ...
    ],
    "PROTECTIONS": ["master"],
    "LABELS": {
        "labelname": {
            "color": "hexcolor",
            "description": "This label means..."
        },
        ...
    }
}

Repository Config

The repository config is not required. Repositories are opted-in for all rules defined in the master config by default. The repo config allows you to opt out of standardization entirely, or opt out of specific rules. If no repository config file is found at runtime, all standardization rules will be applied to the repository.

The custom object allows you to create rules at a repository level. For example, the config file below will create a label called "exampleName", with color "ffffff", and description "label description" in that repository only.

{
    "ISEXEMPT": false,
    "IGNORE": {
        "LABELS": [],
        "TEMPLATES": [],
        "BRANCHPROTECTION": []
    },
    "CUSTOM": {
        "LABELS": {
            "exampleName": {
                "color": "ffffff",
                "description": "label description"
            }
        }
    }
}

gh-standardize's People

Stargazers

 avatar

Watchers

 avatar  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.