https://github.com/cpanato/github-sync
To sync Org Members and Collaborators
https://github.com/cpanato/github-sync
github gitops go golang
Last synced: 6 months ago
JSON representation
To sync Org Members and Collaborators
- Host: GitHub
- URL: https://github.com/cpanato/github-sync
- Owner: cpanato
- License: apache-2.0
- Created: 2021-07-19T09:04:53.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-07-19T11:47:43.000Z (over 4 years ago)
- Last Synced: 2025-04-08T10:41:24.290Z (10 months ago)
- Topics: github, gitops, go, golang
- Language: Go
- Homepage:
- Size: 3.73 MB
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# github-sync
This tool is heavily inspired on [tempelis](https://github.com/kubernetes-sigs/slack-infra/tree/master/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](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-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.
```yaml
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.
```yaml
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