Skip to content

[BUG]: changing github_repository.allow_auto_merge fails in Enterprise account #3353

@jtsaito

Description

@jtsaito

Expected Behavior

On a github_repository adding

allow_auto_merge = true

Should work without error.

Enterprise forking policy):

Image

Organization forking policy:
Image

Actual Behavior

The change creates the following Terraform plan as expceted:

Terraform will perform the following actions:

  # github_repository.lessonnine-stripe-customer-data-deletion-microverse will be updated in-place
  ~ resource "github_repository" "lessonnine-stripe-customer-data-deletion-microverse" {
      ~ allow_auto_merge                        = false -> true
        id                                      = "stripe-customer-data-deletion.microverse"
        name                                    = "stripe-customer-data-deletion.microverse"
        # (40 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

But Terraform apply errors as follows.

The change [creates the following Terraform plan](https://github.com/lessonnine/repositories.infrastructure/actions/runs/24675270789/job/72157643199) as expeted:

Terraform will perform the following actions:

  # github_repository.lessonnine-stripe-customer-data-deletion-microverse will be updated in-place
  ~ resource "github_repository" "lessonnine-stripe-customer-data-deletion-microverse" {
      ~ allow_auto_merge                        = false -> true
        id                                      = "stripe-customer-data-deletion.microverse"
        name                                    = "stripe-customer-data-deletion.microverse"
        # (40 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 1 to change, 0 to destroy.

The actual attribute is still changed correctly and re-applying will result in a clean plan.

Terraform Version

Terraform version: 1.11.4
integrations/github" provider version: 6.11.0

Affected Resource(s)

  • github_repository`

Terraform Configuration Files

resource "github_repository" "xyz" {
  name        = "xyz"
  description = "Foo"

  has_issues   = false
  has_projects = false
  has_wiki     = false

  visibility = "private"

  auto_init              = true
  delete_branch_on_merge = true
  allow_auto_merge       = true
}

Steps to Reproduce

terraform apply

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

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions