Skip to content

[BUG]: Repository description is not preserved in GitHub when 'description' is absent in resource #3287

@jmperez81

Description

@jmperez81

Expected Behavior

The "description" repository field should not be modified if it is absent in resource

Image

Actual Behavior

The description is removed

Image

Terraform Version

Terraform v1.14.6
on darwin_arm64

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

Affected Resource(s)

  • github_repository

Terraform Configuration Files

terraform {
  required_providers {
    github = {
      source  = "integrations/github"
      version = "~> 6.0"
    }
  }
}

provider "github" {
  # token = var.github_token  # or set GITHUB_TOKEN env var
  # owner = var.owner         # or set GITHUB_OWNER env var
}

resource "github_repository" "example" {
  name        = "my-test-repo"
  description = "Some description"
  visibility  = "public"
}

Steps to Reproduce

  1. terraform apply number 1 --> repository is created
  2. Remove description line from resource definition
  3. terraform apply number 2 --> repository description is removed from repository

Debug Output

$ terraform apply
github_repository.example: Refreshing state... [id=my-test-repo]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # github_repository.example will be updated in-place
  ~ resource "github_repository" "example" {
      - description                             = "Some description" -> null
        id                                      = "my-test-repo"
        name                                    = "my-test-repo"
        # (39 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

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

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

github_repository.example: Modifying... [id=my-test-repo]
github_repository.example: Modifications complete after 2s [id=my-test-repo]

Panic Output

N/A

Code of Conduct

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageThis is being looked at and prioritizedType: BugSomething isn't working as documented

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions