Using GitHub to Manage GitHub!
Tags: github, iac, devops, platform
Published: 2023-01-21 16:13:17

# GitHub Organization Management Platform

Updated version here: https://www.osinfra.io/github-organization-management-platform

Managing thousands of repositories across hundreds of users in GitHub can become very complex and tedious. You'll want basic naming conventions on repositories and teams, ways to manage users in those teams, roles, and security settings enforced as a minimum. The [Terraform provider for GitHub][1] allows us to manage our GitHub organization as a platform, just like any other infrastructure. Doing this will reduce technical debt when onboarding, provide ongoing supportability and give a defined [team interaction mode of GitHub-as-a-Service][2].

This open-source [repository][3] is an example of Infrastructure as Code (IaC) for managing a GitHub organization using [Terraform][4], concepts from [Team Topologies][5], and sensible default practices.

Currently, we have the following service interfaces defined by the beta [GitHub Issue Forms][6] that you can see in the [README.md][7]:

- github\_membership service interface: [GitHub Issue][8]
- github\_repository service interface: [GitHub Issue][9]

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qlq2gnkytqdapo87c3f9.png)

Any issue created by an exposed service interface in any platform we build is labeled as a [good first issue][10] and documented to make completion of the work possible within the individual author's cognitive load. These issues align with one of our key concepts of cultivating and developing a strong pool of talented individuals ready to take on work and grow within the organization. They are helping new Infrastructure as Code engineers learn the [GitHub flow][11] through muscle memory. Large organizations will fail at Infrastructure as Code if they expect "traditional" infrastructure engineers to take on the cognitive load of learning and treating infrastructure like code while learning cloud platforms. They are left with, at best, poor automation practices, not Infrastructure as Code.

After we merge a pull request, we use GitHub [reusable workflows][12] with [OIDC][13] to our [Google Cloud Terraform backend Platform][14] to run the terraform plan and use GitHub environments with a [required reviewers][15] protection rule before the [apply job][16] runs. Giving the pull request author a chance to look over the Terraform plan in detail and validate the changes are what they expect.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fa4g1r8pynm202fjord9.png)

We also use [Dependabot][17] and [reusable workflows][18] to keep all our actions and terraform provider dependencies up to date. Along with [CODEOWNERS][19] to ensure the correct platform team is requested to review. The notifications are a bit noisy right now, but we hope to see an option to make a pull request draft by default so code reviewers will only receive notification once the pull request is ready for review.

In conclusion, [GitHub][20] is an extremely powerful tool that, hands down, enables collaboration and learning across engineers. GitHub powers Infrastructure as Code engineers and software engineers by creating a common language and skill set across the platform and stream-aligned teams with a comprehensive, end-to-end infrastructure and software development solution. With that and organizational design like [Team Topologies][21] in place, we see increased success in individuals, teams, organizations, and the software built for their customers.

Technical Documentation (WIP): [docs.osinfra.io][22]

[1]: https://registry.terraform.io/providers/integrations/github/latest/docs
[2]: https://teamtopologies.com/key-concepts
[3]: https://github.com/osinfra-io/github-organization-management
[4]: https://www.terraform.io/
[5]: https://teamtopologies.com/
[6]: https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms
[7]: https://github.com/osinfra-io/github-organization-management#service-interfaces
[8]: https://github.com/osinfra-io/github-organization-management/issues/new?assignees=&labels=enhancement%2Cgood+first+issue&template=github-membership.yml&title=Add+member
[9]: https://github.com/osinfra-io/github-organization-management/issues/new?assignees=&labels=enhancement%2Cgood+first+issue&template=github-repository.yml&title=Add+repository
[10]: https://github.com/orgs/osinfra-io/projects/1
[11]: https://docs.github.com/en/get-started/quickstart/github-flow
[12]: https://github.com/osinfra-io/github-terraform-gcp-called-workflows
[13]: https://github.com/osinfra-io/google-cloud-workload-identity
[14]: https://github.com/osinfra-io/google-cloud-terraform-backend
[15]: https://docs.github.com/en/actions/deployment/targeting-different-environments/using-environments-for-deployment#required-reviewers
[16]: https://github.com/osinfra-io/github-organization-management/actions/runs/3954032932
[17]: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/about-dependabot-version-updates
[18]: https://github.com/osinfra-io/github-misc-called-workflows
[19]: https://github.com/osinfra-io/github-organization-management/blob/main/.github/CODEOWNERS
[20]: https://github.com
[21]: https://teamtopologies.com/
[22]: https://docs.osinfra.io/github/organization-management