Adding and removing members of the CCI-MOC GitHub organization
docs/2026-12-01-adding-github-org-members
Overview
Membership of the CCI-MOC GitHub organization
is managed as code in the
moc-github repository. To add or
remove someone, edit its CSV files in a pull request. When the pull request
merges, the
Apply workflow
runs OpenTofu, which makes the change in GitHub.
Do not add or remove people through the GitHub web UI:
- Organization membership: OpenTofu adds and removes the people listed in
members.csv. It does not touch people who were never listed, so anyone invited through the web UI becomes an untracked member. - Team membership: OpenTofu makes each team match its file in
team-members/. Anyone added to a team through the web UI is removed the next time Apply runs.
This document describes the current CCI-MOC organization. Update it if the organization moves into a different GitHub Enterprise.
Before you start
Collect the following. The email template at the end of this document asks the person for the first three.
- A GitHub account. This process invites by username and cannot invite an email address. If the person has no account, they create one at https://github.com/signup.
- Their GitHub username, from them directly. A typo invites the wrong account.
- Their confirmation that two-factor authentication (2FA) is enabled. GitHub only shows 2FA status for people already in the organization, so an owner checks it again after they join (see Verify).
- Which teams they need. Organization membership alone grants no repository
access (
default_repository_permission = "none"inorganization.tf). Teams are listed inteams.csv, and their repository access is set inrepositories.tf. - Who the person is, why they need access, and who sponsors them. This goes in the commit message and is the record of the request.
Adding a member
-
Make the changes below on a new branch of
moc-github. You can use git or GitHub’s web editor (the pencil icon on a file). If you have write access tomoc-github, create the branch there rather than in a fork; see step 5. -
In
members.csv, add one line for the person, for example at the end of the file:newuser,memberUse
memberfor almost everyone.adminmakes the person an organization owner; reserve it for people who administer the organization itself. Everyone inmembers.csvis also added automatically to theall-membersteam. -
For each team they need, add a line to that team’s file in
team-members/, for exampleteam-members/esi.csv:newuser,memberThe role here is
memberormaintainer. If the person is an organization owner (admininmembers.csv), usemaintainerin every team, or every plan will show a change. -
Commit with a message that names the person, the reason, and the sponsor, for example:
Add Jane Doe to cci-moc organization Jane is a BU IS&T Engineer collaborating on X. Sponsor: Y. -
Open a pull request.
- From a branch in
moc-github: the Plan workflow runs. Open it from the pull request’s checks and read theTF Planstep. It should show only your changes: a newgithub_membershipand updates to the teams you edited. - From a fork: Plan does not run. For a simple addition that is usually fine, but reviewers should check the username and CSV lines by eye. The plan matters more for changes to teams, repositories, or admin roles, because Apply applies the whole configuration, including any unrelated pending changes.
- From a branch in
-
Get two approving reviews and a passing
pre-commitcheck, then merge with “Squash and merge” or “Rebase and merge”. The repository requires linear history, so a merge commit is not allowed. -
Apply runs automatically and GitHub emails the person an invitation. They are not a member, and their team memberships do not take effect, until they accept it.
Verify
- The Apply run on
mainsucceeded, in themoc-githubActions tab. - After the person accepts, they appear on the organization’s People page and on the pages of their teams.
- An organization owner checks 2FA: on the People page, use the “Two-factor authentication” filter and make sure the person is not listed under “Disabled”. If they are, ask them to enable it.
Removing a member
Removing a line from members.csv does remove the person: when Apply runs,
OpenTofu removes them from the organization, or cancels their invitation if
they have not accepted it. (OpenTofu only ignores people who were never in
the file.)
Remove every reference to the person in the same pull request, not just the
members.csv line:
- Every file in
team-members/. If they stay listed in a team, the next Apply tries to add them back to that team, and adding someone outside the organization to a team sends them a new organization invitation. - Any
users = { ... }block inrepositories.tf. Those blocks grant access directly to one repository, and the next Apply would try to restore it.
To find every reference, search for the username. Both methods below ignore
case and also match longer names (such as jdoe2), so check each hit.
-
On GitHub, enter
repo:CCI-MOC/moc-github jdoein the search box. This searchesmainonly. -
In a clone:
grep -rin "jdoe" members.csv team-members/ repositories.tf
Then follow steps 4 to 6 above, with a commit message that says why the person is being removed.
If the person is in the organization but not in members.csv, they were
added outside this process and OpenTofu cannot remove them. An organization
owner removes them from the People page.
Related
- The
moc-githubREADME covers creating repositories and teams.
Email template
Send this to the person before opening the pull request. Replace the placeholders in angle brackets.
Subject: GitHub access for the Mass Open Cloud (CCI-MOC)
Hi <name>,
To give you access to the Mass Open Cloud's GitHub organization (CCI-MOC), I need two things from you:
1. Your GitHub username. It is the name in your profile address, github.com/<username>. If you don't have a GitHub account yet, create one at https://github.com/signup (instructions: https://docs.github.com/en/get-started/start-your-journey/creating-an-account-on-github).
2. Confirmation that two-factor authentication (2FA) is turned on for that account. To check or enable it: click your profile picture at the top right of GitHub, choose Settings, then Password and authentication, and under "Two-factor authentication" click "Enable two-factor authentication". Full instructions: https://docs.github.com/en/authentication/securing-your-account-with-two-factor-authentication-2fa/configuring-two-factor-authentication
Once you're added, GitHub will email you an invitation to join CCI-MOC. Please accept it; your access starts only after you do.
Thanks,
<your name>