Skip to content

[BUG]: github_repository reports drift on merge_commit_message and merge_commit_title if allow_merge_commit is false #3554

Description

@ecerulm

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

  1. added
    Type: Bug
    Status: Triage
    on Jul 20, 2026
  2. github-actions commented on Jul 20, 2026

    @github-actions

    👋 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.

  3. added a commit that references this issue on Jul 20, 2026
    b4a716f
  4. deiga commented on Jul 20, 2026

    @deiga
    Collaborator

    This is somewhat a duplicate of #2264

  5. added a commit that references this issue on Jul 20, 2026
    5833935
  6. added theissue type on Jul 22, 2026
  7. robert-crandall commented on Nov 25, 2026

    @robert-crandall
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: TriageType: Bugr/repository

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions