integrations / terraform-provider-github

Terraform GitHub provider
https://www.terraform.io/docs/providers/github/
MIT License
891 stars 736 forks source link

[BUG]: Drift detected for allow_squash_merge, allow_update_branch delete_branch_on_merge despite no change #2246

Open tekumara opened 5 months ago

tekumara commented 5 months ago

Expected Behavior

No drift

Actual Behavior

Drift detected for allow_squash_merge, allow_update_branch delete_branch_on_merge despite no change.

! resource "github_repository" "repo" {
!       allow_squash_merge          = false -> true
!       allow_update_branch         = false -> true
!       delete_branch_on_merge      = false -> true
+       merge_commit_message        = "PR_TITLE"
+       merge_commit_title          = "MERGE_MESSAGE"
+       squash_merge_commit_message = "PR_BODY"
+       squash_merge_commit_title   = "PR_TITLE"
    }

Terraform Version

v1.8.1

Affected Resource(s)

Terraform Configuration Files

No response

Steps to Reproduce

No response

Debug Output

No response

Panic Output

No response

Code of Conduct

edubxb commented 2 months ago

Hello!

We ran into the same issue; on every plan, we have drift in random repositories, making it challenging to track real code changes and what the plan says.

image

garysassano commented 2 months ago

Just to make sure, have you read the documentation?

image

edubxb commented 2 months ago

Hi!

Yes, in our case, we are using GitHub App auth, but I can't find that information in the docs (Terraform registry).

https://registry.terraform.io/providers/integrations/github/latest/docs#github-app-installation

Edit:

I found it...

https://registry.terraform.io/providers/integrations/github/latest/docs/resources/repository

Thanks!

Edit 2:

I can confirm that after updating the app permissions, the drift disappeared.

Thanks @garysassano!