Skip to content

Repository files navigation

github-operator

An operator to manage policy-as-code and apply repository settings to repositories across an organization.

Guide

Deployment

  1. Create GitHub Token with access to repo, write:org, and read:org
  2. Deploy on Kubernetes cluster:
git clone github.com/Hunter-Thompson/github-operator
cd github-operator
kubectl create secret generic github-operator-secret --from-literal GITHUB_TOKEN=ghp_sjdnfksdfnjksdf kubectl apply -f docs/install.yaml

Team

# https://docs.github.com/en/rest/teams/teams?apiVersion=2022-11-28#create-a-team# https://docs.github.com/en/rest/teams/teams?apiVersion=2022-11-28#update-a-teamapiVersion: settings.github.com/v1beta1kind: Teammetadata:
name: team-samplespec:
organization: ocktokitdescription: 'asd'maintainers:
- Hunter-ThompsonrepoNames:
- repo1
- anotherrepoprivacy: secretparentTeamId: 1829

Repository

# https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#create-an-organization-repository# https://docs.github.com/en/rest/repos/repos?apiVersion=2022-11-28#update-a-repositoryapiVersion: settings.github.com/v1beta1kind: Repositorymetadata:
name: repo-samplespec:
organization: ocktokitdescription: "asd"homepage: "https://home.page"topics:
- topic1
- topic2private: falsehasIssues: falsehasPages: falsehasWiki: falsedefaultBranch: masterallowSquashMerge: trueallowMergeCommit: trueallowRebaseMerge: trueallowAutoMerge: truedeleteBranchOnMerge: trueisTemplate: falsesquashMergeCommitTitle: "PR_TITLE"squashMergeCommitMessage: "COMMIT_MESSAGES"mergeCommitTitle: "PR_TITLE"mergeCommitMessage: "PR_BODY"repositoryCollaborators:
adminPermission:
- Hunter-Thompson1pushPermission:
- Hunter-Thompson2pullPermission:
- Hunter-Thompson3

License

Copyright 2023.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

An operator to manage policy-as-code and apply repository settings to repositories across an organization.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages