Skip to content

[BUG]: github_organization_role_team resource causes permanent drift in github_repository_collaborators #3178

@christianfaucher

Description

@christianfaucher

Expected Behavior

After running "terraform apply", the "github_repository_collaborators" resource should not detect any drift.

Actual Behavior

After running "terraform apply", every subsequent plan or apply detects drift in the "github_repository_collaborators" resource.

Example:

  # github_repository_collaborators.some_repo_collaborators will be updated in-place
  ~ resource "github_repository_collaborators" "some_repo_collaborators" {
        id             = "some-repo"
        # (2 unchanged attributes hidden)

      - team {
          - permission = "pull" -> null
          - team_id    = "16178939" -> null
        }

        # (1 unchanged block hidden)
    }

We have this behavior in a GitHub Enterprise Cloud EMU environment without data residency.

Terraform Version

Terraform v1.14.4
on darwin_arm64

  • provider registry.terraform.io/integrations/github v6.11.0

Affected Resource(s)

  • github_repository_collaborators

Terraform Configuration Files

terraform {
  required_providers {
    github = {
      source  = "integrations/github"
      version = ">= 6.7.0"
    }
  }
  required_version = "~> 1.0"

  backend "local" {
    path = "terraform.tfstate"
  }
}

provider "github" {}

resource "github_team" "some_team" {
  name        = "SomeTeam"
  description = "Some cool team"
}

resource "github_repository" "some_repo" {
  name = "some-repo"
  visibility = "private"
}

resource "github_repository_collaborators" "some_repo_collaborators" {
  repository = github_repository.some_repo.name

  team {
    permission = "pull"
    team_id = github_team.some_team.id
  }
}

resource "github_team" "some_security_team" {
  name        = "SomeSecurityTeam"
}

resource "github_organization_role_team" "test-team-role-assignment" {
  team_slug = github_team.some_security_team.slug
  role_id   = "138" # security_manager (predefined)
}

Steps to Reproduce

terraform init
terraform apply
terraform plan

Debug Output

Panic Output

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: SupportAny questions, information, or general needs around the SDK or GitHub APIs

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions