terraform-provider-github icon indicating copy to clipboard operation
terraform-provider-github copied to clipboard

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

Open tekumara opened this issue 1 year ago • 3 comments

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)

  • github_repository repo

Terraform Configuration Files

No response

Steps to Reproduce

No response

Debug Output

No response

Panic Output

No response

Code of Conduct

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

tekumara avatar May 01 '24 01:05 tekumara

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

edubxb avatar Jul 25 '24 13:07 edubxb

Just to make sure, have you read the documentation?

image

garysassano avatar Jul 25 '24 13:07 garysassano

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!

edubxb avatar Jul 25 '24 14:07 edubxb

👋 Hey Friends, this issue has been automatically marked as stale because it has no recent activity. It will be closed if no further activity occurs. Please add the Status: Pinned label if you feel that this issue needs to remain open/active. Thank you for your contributions and help in keeping things tidy!

github-actions[bot] avatar Apr 22 '25 02:04 github-actions[bot]

Thank you @garysassano I'll give that a go.

tekumara avatar May 01 '25 23:05 tekumara