Skip to content

Unable to set require_linear_history in github_branch_protection to True #952

Closed as not planned

Description

@leosunmo

Terraform Version

Running Atlantis
Terraform v0.15.3
on linux_amd64

  • provider registry.terraform.io/integrations/github v4.17.0

Affected Resource(s)

Please list the resources as a list, for example:

  • github_branch_protection
  • require_linear_history

Expected Behavior

When using require_linear_history = true in a github_branch_protection block it should enable it in the Github API

Actual Behavior

Terraform seems unable to set it to true as it keeps coming up in plans.

The follow plan appears every time it's executed:

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
~ update in-place

Terraform will perform the following actions:

  # module.my-repo.github_branch_protection.repo_branch_protection["branch1"] will be updated in-place
~ resource "github_branch_protection" "repo_branch_protection" {
      ~ required_linear_history = false -> true
        # (7 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

  # module.my-repo.github_branch_protection.repo_branch_protection["branch2"] will be updated in-place
~ resource "github_branch_protection" "repo_branch_protection" {
      ~ required_linear_history = false -> true
        # (7 unchanged attributes hidden)

        # (2 unchanged blocks hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

Steps to Reproduce

  1. terraform plan in an unchanged state
  2. See changes to require_linear_history every time.

References

This is mentioned here as well, #887 (comment), but figured we should open a real issue.

Activity

  1. alexbde commented on Nov 3, 2021

    @alexbde

    Just leaving a quick note here: we're experiencing the same issue with GHES 3.1, Terraform 1.0.7, and github-provider 4.17. It is happening for attributes github_branch_protection.required_linear_history and github_repository.allow_auto_merge.

    Root cause is the GHES 3.1 not supporting setting these attributes via API. It is added in GHES 3.2.

  2. github-actions commented on Nov 30, 2022

    @github-actions

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

  3. added
    Status: Stale
    and removed on Nov 30, 2022
  4. added
    Type: Bug
    on Dec 1, 2022
  5. removed
    Status: Stale
    on Dec 1, 2022
  6. github-actions commented on Apr 21, 2024

    @github-actions

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

  7. added
    Status: Stale
    on Apr 21, 2024
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: StaleType: Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions