Skip to content

[BUG]: Deleting github_repository_file resource might not remove the file #2464

@frankywahl

Description

@frankywahl

Expected Behavior

When a successful apply of a destruction, I would not expect to see the file in the repository anymore

Actual Behavior

Even if there is an HTTP error, the terraform process exits successfully.

Terraform Version

Terraform v1.9.8
on darwin_arm64

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

Affected Resource(s)

  • github_repository_file

Terraform Configuration Files

No response

Steps to Reproduce

  1. Create the resource
  2. Delete the resource after changing ownership preventing you from doing so.
resource "github_repository_file" "foo" {
  repository          = "tmp"
  branch              = "main"
  file                = ".gitignore"
  content             = "**/*.tfstate"
  commit_message      = "Managed by Terraform"
  commit_author       = "Terraform User"
  commit_email        = "terraform@example.com"
  overwrite_on_create = true
}

then

// resource "github_repository_file" "foo" {
//   repository          = "tmp"
//   branch              = "main"
//   file                = ".gitignore"
//   content             = "**/*.tfstate"
//   commit_message      = "Managed by Terraform"
//   commit_author       = "Terraform User"
//   commit_email        = "terraform@example.com"
//   overwrite_on_create = true
// }

Debug Output

No response

Panic Output

No response

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

    Status

    ✅ Done

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions