Guide

GitHub Collaborator Permissions: Every Level, and How to Review Them

What a GitHub collaborator can do on a personal or an organization repository, the six repository roles, outside collaborators, and how to review them.

Part of the guide User Access Review: How to Run One, Step by Step

10 min readLast updated

Someone asked you who outside the company can see your code on GitHub, or an auditor picked GitHub for a sample in your access review. To answer, you need to know what each collaborator permission allows, where people get access from, and how to list it. GitHub collaborator permissions depend on who owns the repository. On a repository owned by a personal account, every collaborator gets the same level: they can read and push code, but cannot change settings, add people or delete it. On an organization repository, each person or team gets one of six roles, from Read to Admin.

What a collaborator is on GitHub

A repository is one project’s code and its history. A collaborator is a GitHub user who was given access to a repository they do not own. Who can grant that access, and at what level, depends on the owner:

  • A personal account is one person’s GitHub login. Its repositories have two levels only: the owner and collaborators.
  • An organization is a shared account for a company or team. Its repositories have roles, and access can come from several places at once.

Companies usually keep their code in an organization. Personal repositories still matter in a review, because staff sometimes keep company code or scripts there, and the company has no say over who the owner invites.

Permissions on a personal account repository

GitHub’s page on permission levels for a personal account repository lists what each level can do. The short version:

Personal account repository: owner and collaborator
LevelWhat they can do
CollaboratorRead and push code, fork (make their own copy of the repository), create and merge pull requests, rename branches other than the default one, create, close and assign issues, edit wikis and releases, act as a code owner, publish packages, and remove themselves.
OwnerEverything a collaborator can do. Plus: invite collaborators, manage webhooks and deploy keys (keys that give a server access to one repository), change visibility, and delete or archive the repository. The owner can also rename the default branch, merge on protected branches without approving reviews, and manage security settings and alerts.

A point that is easy to miss: GitHub says collaborators on a personal repository cannot have read-only access. Anyone invited can push code. If you need someone to read without writing, the repository has to move into an organization.

The six repository roles in an organization

In an organization, GitHub’s page on repository roles for an organization defines six roles, from least to most access. Each role includes the access of the roles before it, except Moderate, which lacks a few things Read and Triage have, such as viewing packages.

Repository roles in a GitHub organization
RoleWhat it addsWho GitHub suggests it for
ReadPull (download) the code, fork it, open issues, comment, and view releases and workflow runs.People who want to view or discuss the project without writing code.
TriageApply labels, assign, close and reopen issues and pull requests, and request reviews. No push.People who manage issues and pull requests without write access.
ModerateEdit anyone’s issues and comments on issues, lock issue conversations and transfer issues. No push.People who moderate issues and discussions without write access.
WritePush code, merge pull requests, approve pull requests with required reviews, run GitHub Actions workflows, and create, change and delete Actions secrets and variables.People who actively push to the project.
MaintainPush to protected branches (branches with rules that block direct changes), edit the description and topics, configure pull request merges and Pages publishing, and limit interactions.People who manage the repository without sensitive or destructive actions.
AdminManage who has access, change settings and visibility, manage branch protection rules and rulesets, manage webhooks and deploy keys, and delete, transfer or archive the repository.People who need full access, including managing security and deleting the repository.

Two rows deserve a second look in a review. Write is more than “can push code”: it can also create and run GitHub Actions workflows (automated jobs that build and deploy code) and change the secrets they use, such as the credentials for your cloud account. Admin can give access to others, so treat it as privileged access and review it the way the privileged user access review guide describes. Organizations on GitHub Enterprise Cloud can also create custom repository roles. List those by name in your review, with what each one contains.

How to add a collaborator or change their role

In an organization repository, a person with the Admin role does this in the repository’s settings, as GitHub’s page on managing access to a repository describes:

  1. Open the access page. On the repository, click Settings, then Collaborators & teams in the “Access” section of the sidebar.
  2. Add someone. Click Add people or Add teams, pick the name, choose the role under “Choose a role”, and confirm.
  3. Change a role. Next to the person or team, open the Role menu and pick the new role.

On a personal account repository there is no role to choose: every collaborator gets the same level, so the only choices are to invite them or remove them.

Where a person’s access comes from

In an organization, one person can hold access to the same repository from several places. GitHub’s REST API documentation for collaborators says the role it reports is the highest one after it counts all of them. The main sources are:

  • Organization owners. GitHub says owners have admin access to every repository the organization owns.
  • Base permissions. Owners can set a level, such as Read or Write, that every member gets on every repository. GitHub’s page on setting base permissions says a higher level given on one repository overrides it.
  • Organization roles. Owners can give a member or team a role at the organization level, and some of these include access to every repository. GitHub’s page on roles in an organization says the security manager role, for example, gives read access to all repositories in the organization. The GitHub roles guide lists every organization role and what it allows.
  • Teams. A team is a group of members given a role on a repository. GitHub’s page about teams says child teams inherit the parent team’s access.
  • Direct access. A person added to the repository on their own, with a role.
  • Outside collaborators. People who are not members, added repository by repository.

This matters for the person reviewing. If you remove someone’s direct access but they also get Write from a team, they still have Write. GitHub’s page on managing access to a repository says the repository’s access page shows a “Mixed roles” warning next to a person who was given conflicting access, and clicking it shows the source. No warning does not mean one source only, so also check the person’s teams before you mark a removal as done, and remove the access at its source.

Outside collaborators: the accounts to check first

GitHub defines an outside collaborator as a person who has access to one or more of your organization’s repositories but is not a member of it, such as a consultant or a temporary employee. Its pages on adding outside collaborators and on base permissions add three facts worth knowing:

  • Base permissions do not apply to them, and they cannot be added to a team. Each grant is made by hand on one repository, which is why they are easy to forget.
  • If your organization requires two-factor authentication, they must turn it on before they can accept the invitation.
  • Unless you are on the free plan, each outside collaborator on a private repository uses one of your paid licenses.

Outside collaborators are often missing from your HR system, so a contract that ends may not trigger the leaver process. The access then keeps working until someone removes it. That is one way an orphaned account appears.

How to review GitHub collaborator access

You can run this with an export, a spreadsheet and one person who knows each repository. The free user access review template has the columns.

  1. List the organization owners. Owners have admin access everywhere, so each one needs a reason. Keep this list short and review it first.
  2. List the outside collaborators. For each one, record the repositories they can reach, their role on each, and the person inside the company who asked for the access.
  3. List each repository’s people and teams with their role. In the repository’s settings, the “Collaborators & teams” page shows who has access. Include the base permission level and every custom role.
  4. Send each line to someone who knows the work. The manager for staff, the sponsor for outside collaborators, the repository owner for teams. Ask for keep or remove, and a reason for every Admin and Write line.
  5. Remove access at its source. Change the team, the direct grant or the base permission, whichever gave the access. GitHub says that when a person is removed from a private repository, their forks of it are deleted, but their local copies stay with them. Its base permissions page adds that changing base permissions does not update private forks on its own.
  6. Check again and keep the record. Pull the list a second time to confirm each removal, and search the GitHub audit log for the removal events. Then save the first list, the decisions with who made them and when, the audit log exports and the second list together.

Do not forget access that is not tied to a person. GitHub warns that anyone holding the private key of a deploy key can read from or write to the repository, depending on the key’s settings, even after they leave the organization. Repository admins can see deploy keys in the repository settings. Include them in the review with a named owner each, and do the same for the GitHub Apps installed in the organization, which act with the permissions they were granted.

A script to list outside collaborators and their roles

This is for the engineer who runs the export. It uses the GitHub CLI, reads only, and needs a login as an organization owner, because GitHub’s API lists a repository’s collaborators only for people with write, maintain or admin access to it. It lists every outside collaborator on every repository with their role, as tab-separated text you can paste into a spreadsheet.

#!/usr/bin/env bash
# Reads only. Needs the GitHub CLI (gh), logged in as an organization owner.
set -euo pipefail
ORG=${ORG:?set ORG to your organization name}

printf 'repository\tlogin\trole\n'
gh api --paginate "orgs/$ORG/repos?per_page=100" --jq '.[].name' |
  while read -r repo; do
    gh api --paginate "repos/$ORG/$repo/collaborators?affiliation=outside&per_page=100" \
      --jq ".[] | [\"$repo\", .login, .role_name] | @tsv"
  done

Change affiliation=outside to affiliation=all for every person with access, including members who get it from a team, the base permission or an owner role. GitHub notes that this API reports the highest role only and cannot tell you whether it came from the organization or the repository, so use the repository’s settings page to find the source of a line you plan to remove. To list outside collaborators without two-factor authentication, run gh api --paginate "orgs/$ORG/outside_collaborators?filter=2fa_disabled&per_page=100" --jq '.[].login'.

A few things to know about the output. The roles print with their API names, such as read and write. Archived repositories and forks are included. Invitations not yet accepted are not, and GitHub lists those per repository under repos/$ORG/$repo/invitations. If one repository returns an error, the script stops there, so rerun it after you fix the cause.

How often to review, and what the frameworks say

SOC 2 and ISO 27001 set no interval for access reviews. Your own policy does, and your auditor tests that you kept to it. If PCI DSS applies to your systems, PCI DSS v4.0.1 requirement 7.2.4 says user accounts and access privileges are reviewed at least once every six months. You can review Admin and outside collaborator access more often than the rest. That is a choice, not a rule. The user access review guide covers the whole process across your systems.

Where Acciew fits

Acciew, in early access, runs the listing and asking steps of this review for GitHub organizations, and for Keycloak and AWS. It reads the members, the teams and who is in them, and which people and teams have access to each repository and at what level, then sends each manager an email link to their own short list. It only reads, so removing access stays with your administrators.

Have an access review coming up?

Acciew is in early access. We are looking for design partners: teams with a user access review ahead of them.

Apply as a design partner

Questions and answers

Can I give a GitHub collaborator read-only access?

Not on a repository owned by a personal account. GitHub says collaborators there cannot have read-only access, and on a private one the owner can only grant write access. Move the repository into an organization, where you can give each person or team the Read role.

What is the difference between a member and an outside collaborator on GitHub?

A member belongs to the organization, can join its teams and gets the base permissions the owners set for every member. An outside collaborator is not a member and has access only to the repositories they were added to, one by one. Base permissions do not apply to them, and they cannot be added to a team.

Can a collaborator delete my GitHub repository?

On a personal account repository, no: deleting the repository is one of the things only the owner can do. On an organization repository, only the Admin role can delete or transfer it, and organization owners have admin access to every repository. Owners can also limit some of these actions further in the organization settings.

What happens when you remove a collaborator from a GitHub repository?

They lose access to the repository. If it is private, their forks of it are deleted too. Any copy they cloned to their own computer stays with them, so GitHub reminds you that it is up to you to make sure they delete confidential material.

Does GitHub show when a collaborator last used their access?

The collaborator list in the repository settings and the collaborators API show who has access and at what level, not when each person last used it. To judge whether access is still needed, ask the person who knows the work, such as the manager or the repository owner, and record their answer.