Skip to content

GithubOrganization CRD ​

GithubOrganization is a namespace-scoped resource that represents a GitHub organization managed by Repo Guard. It controls organization-level policies: default repository team permissions, organization owner enforcement, and team lifecycle.

Example ​

yaml
apiVersion: repo-guard.cloudoperators.dev/v1
kind: GithubOrganization
metadata:
  name: com--greenhouse-sandbox
  namespace: default
  labels:
    repo-guard.cloudoperators.dev/addTeam: "true"
    repo-guard.cloudoperators.dev/removeTeam: "true"
    repo-guard.cloudoperators.dev/addOrganizationOwner: "true"
    repo-guard.cloudoperators.dev/removeOrganizationOwner: "true"
    repo-guard.cloudoperators.dev/addRepositoryTeam: "true"
    repo-guard.cloudoperators.dev/removeRepositoryTeam: "true"
    repo-guard.cloudoperators.dev/dryRun: "false"
spec:
  github: com
  organization: greenhouse-sandbox
  organizationOwnerTeams:
    - org-admins
  defaultPublicRepositoryTeams:
    - team: public-pull-team
      permission: pull
    - team: public-push-team
      permission: push
    - team: public-admin-team
      permission: admin
  defaultPrivateRepositoryTeams:
    - team: private-pull-team
      permission: pull
    - team: private-push-team
      permission: push
    - team: private-admin-team
      permission: admin
  defaultInternalRepositoryTeams:
    - team: internal-pull-team
      permission: pull
  installationID: 43715277

Spec Fields ​

FieldTypeRequiredDescription
githubstringYesName of the Github (cluster-scoped) resource to use for API access.
organizationstringYesGitHub organization slug.
installationIDintegerYesGitHub App installation ID for this organization.
organizationOwnerTeams[]stringNoList of GitHub team slugs whose members should be organization owners.
defaultPublicRepositoryTeams[]TeamPermissionNoDefault team permissions applied to every public repository.
defaultPrivateRepositoryTeams[]TeamPermissionNoDefault team permissions applied to every private repository.
defaultInternalRepositoryTeams[]TeamPermissionNoDefault team permissions applied to every internal repository.
protectedMembers[]stringNoGitHub logins exempt from removeOrganizationMember and removeRepositoryDirectCollaborator.

TeamPermission ​

FieldTypeDescription
teamstringGitHub team slug.
permissionstringOne of pull, push, admin, maintain, triage.

Labels ​

See the full Labels Reference for all supported labels.

KeyEffect
repo-guard.cloudoperators.dev/addTeamCreate missing teams.
repo-guard.cloudoperators.dev/removeTeamDelete out-of-policy teams.
repo-guard.cloudoperators.dev/addOrganizationOwnerAdd missing org owners.
repo-guard.cloudoperators.dev/removeOrganizationOwnerRemove extra org owners.
repo-guard.cloudoperators.dev/addRepositoryTeamApply default repo team permissions.
repo-guard.cloudoperators.dev/removeRepositoryTeamRemove default repo team permissions.
repo-guard.cloudoperators.dev/removeOrganizationMemberRemove org members not in any team ("dryRun" supported).
repo-guard.cloudoperators.dev/removeRepositoryDirectCollaboratorRemove direct repo collaborators ("dryRun" supported).
repo-guard.cloudoperators.dev/dryRunPrevent all mutations; write planned operations to status.

Annotations ​

KeyDescription
repo-guard.cloudoperators.dev/skipDefaultRepositoryTeamsComma-separated list of repository names to skip when applying default team permissions.

Released under the Apache 2.0 License.