Repository navigation
Description
Expected Behavior
When allow_merge_commit = false in github_repository I would expect the values of merge_commit_title and merge_commit_message to be ignored as they can't be changed if merge commits are disabled.
Actual Behavior
I had the following settings applied
allow_merge_commits = true
merge_commit_message = "PR_BODY"
merge_commit_title = "PR_TITLE"
then when I flipped allow_merge_commmits = false
allow_merge_commits = true
merge_commit_message = "PR_BODY"
merge_commit_title = "PR_TITLE"
and applied that.
Now if I plan again I get the following drift:
! merge_commit_message = "PR_TITLE" -> "PR_BODY"
! merge_commit_title = "MERGE_MESSAGE" -> "PR_TITLE"
Terraform Version
Terraform v1.15.8
on linux_arm64
- provider registry.terraform.io/hashicorp/google v7.38.0
- provider registry.terraform.io/integrations/github v6.12.1
GitHub Installation Type
- GitHub.com (Free, Pro, or Team)
- GitHub Enterprise Server (on-premises)
- GitHub Enterprise Cloud with Personal Accounts (github.com)
- GitHub Enterprise Cloud with Managed Users/EMU (github.com)
- GitHub Enterprise Cloud with Data Residency (*.ghe.com)
- I don't know
Affected Resource(s)
- github_repository
Terraform Configuration Files
Steps to Reproduce
I can't copy my actual terraform configuration here, but I think this is the gist of it
terraform config
resource "github_repository" "this" {
name = "test"
description = ""
delete_branch_on_merge = true
auto_init = true
allow_update_branch = true
allow_merge_commit = true
allow_rebase_merge = true
allow_squash_merge = true
squash_merge_commit_title = "PR_TITLE"
squash_merge_commit_message = "PR_BODY"
merge_commit_title = "PR_TITLE"
merge_commit_message = "PR_BODY"
}
terraform plan & apply that.
Then change allow_merge_commit = false
terraform plan & apply that (it will work fine).
Then terraform plan again, it will show drift in merge_commit_title and merge_commit_message:
resource "github_repository" "this" {
id = "xxxxx"
! merge_commit_message = "PR_TITLE" -> "PR_BODY"
! merge_commit_title = "MERGE_MESSAGE" -> "PR_TITLE"
name = "xxxx"
# (40 unchanged attributes hidden)
# (1 unchanged block hidden)
}
So it believes that current value of merge_commit_message = PR_TITLE which I guess it the GitHub defaults ( GitHub repo > Settings > General > Pull Requests > Allow merge commits > Default message will set merge_commit_title: "MERGE_MESSAGE", merge_commit_message: "PR_TITLE")
Debug Output
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
github-actions commentedon Jul 20, 2026
👋 Hi, and thank you for opening this issue!
This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can.
You can help us prioritize by adding details, reproduction steps, or a 👍 to issues that matter to you, and by joining the discussion on open issues and PRs.
🤖 This is an automated message.
fix: Avoid merge_commit_* drift when merge/squash strategies are disa…
deiga commentedon Jul 20, 2026
This is somewhat a duplicate of #2264
fix: Suppress merge/squash commit title/message diff when strategy is…
robert-crandall commentedon Nov 25, 2026
Linking #3558 from @ecerulm here for reference. We closed it as part of our temporary move to an issue-first model (see CONTRIBUTING.md), and want to keep the context and implementation approach handy when we pick this issue up.