GitHub fine-grained PAT guidance for repod

repod only supports fine-grained personal access tokens (FGPATs). Do not use Tokens (classic) -- those use legacy scopes like repo / admin:org and do not match repod's permission checks or least-privilege recommendations.

Related guide: GitHub repo naming, nested teams, and permissions for private orgs.

Create the token (GitHub UI checklist)

  1. Go to Settings -> Developer settings -> Personal access tokens -> Fine-grained tokens.
  2. Set Resource owner to the organization you want repod to sync (not your personal account).
  3. Set an Expiration (shorter is better; rotate regularly).
  4. Set Repository access:
    • All repositories (recommended for accurate org-wide mapping), or
    • Only select repositories (repod will show coverage gaps for repos not included).

If your org requires approval for fine-grained PATs, an org owner may need to approve the token request before it works.

Select permissions

Apply repo-to-team permission changes (repod write mode)

Use this only if you want repod to apply changes like:

Required permissions

AreaPermissionLevel
OrganizationMembersRead
OrganizationOrganization private repositoriesRead
RepositoryMetadataRead
RepositoryAdministrationRead and write

GitHub's Add or update team repository permissions (and removal) requires Administration (write) + Members (read) + Metadata (read).

Optional add-on: Team management (CRUD) in the organization

Enable this only if you want repod (or your automation) to manage teams themselves, e.g.:

Add this permission on top

Organization permissions

Why

Notes: This is a meaningful increase in power. Use a dedicated machine user and rotate aggressively.

Troubleshooting (permission-to-symptom mapping)

Tip: GitHub REST responses may include X-Accepted-GitHub-Permissions, which tells you exactly what permission(s) the endpoint expects.

Mapping from classic PAT scopes (for clarity only)

Once PAT scopes are working, continue with our guide to GitHub repo naming, nested teams, and permissions to shape the wider org model.