Skip to content

nicolas-carlier-ls/github-sync

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

github-sync

This tool is heavily inspired on tempelis

It syncronizes the configuration described in a YAML file against your GitHub Organization. Combined with a CI system, it can be used to implement GitOps for GitHub.

At this stage, it can:

Org Members

  • Add users to an organization
  • Remove users from an organization

Collaborators

  • Add collaborators to a repository
  • Remove collaborators from a repository

Config

Authentication

It expects a config file in the location given by --auth that looks like this:

{
    "authToken": "ic3hu6ydebbsib1yd7x5wn1nro",
    "org": "YOUR_GITHUB_ORG"
}

authToken is the GitHub Token

Users

It expects a complete list of Org Members to be provided. If a org member exists on GitHub that is not in the yaml users list, it will error out.

users:
- username: cpanato
  role: admin # possibles are `admin` / `direct_member` / `billing_manager`
  email: dont@honk.at.me
- username: honk_user
  role: admin  # possibles are `admin` / `direct_member` / `billing_manager`
  email: test4@example.com

Collaborators

It expects a complete list of Repositories and Collaborators to be provided. If a collaborator exists on GitHub that is not in the yaml repositories list, it will error out.

repositories:
- name: playground
  collaborators:
  - username: username_1
    email: test@example.com
    permission: push # possibles are `pull` / `push` / `admin` / `maintain` / `triage`
  - username: username_2
    email: test2@example.com
    permission: push # possibles are `pull` / `push` / `admin` / `maintain` / `triage`
- name: another_repo
  collaborators:
  - username: username_3
    email: test3@example.com
    permission: push # possibles are `pull` / `push` / `admin` / `maintain` / `triage`

Future Work

Add support:

  • Repositories configuration
  • Teams

About

To sync Org Members and Collaborators

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 88.4%
  • Shell 7.3%
  • Makefile 4.3%