From f0bd733636c5ad4f170431aea202075aeee781ed Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Fri, 8 Oct 2021 14:13:54 +0100 Subject: [PATCH] Adding missing RequiresLinearHistory --- github/resource_github_branch_protection.go | 2 ++ github/resource_github_branch_protection_test.go | 3 +++ 2 files changed, 5 insertions(+) diff --git a/github/resource_github_branch_protection.go b/github/resource_github_branch_protection.go index 1f99a3db5a..2f42cc4526 100644 --- a/github/resource_github_branch_protection.go +++ b/github/resource_github_branch_protection.go @@ -153,6 +153,7 @@ func resourceGithubBranchProtectionCreate(d *schema.ResourceData, meta interface RequiresApprovingReviews: githubv4.NewBoolean(githubv4.Boolean(data.RequiresApprovingReviews)), RequiresCodeOwnerReviews: githubv4.NewBoolean(githubv4.Boolean(data.RequiresCodeOwnerReviews)), RequiresCommitSignatures: githubv4.NewBoolean(githubv4.Boolean(data.RequiresCommitSignatures)), + RequiresLinearHistory: githubv4.NewBoolean(githubv4.Boolean(data.RequiresLinearHistory)), RequiresStatusChecks: githubv4.NewBoolean(githubv4.Boolean(data.RequiresStatusChecks)), RequiresStrictStatusChecks: githubv4.NewBoolean(githubv4.Boolean(data.RequiresStrictStatusChecks)), RestrictsPushes: githubv4.NewBoolean(githubv4.Boolean(data.RestrictsPushes)), @@ -273,6 +274,7 @@ func resourceGithubBranchProtectionUpdate(d *schema.ResourceData, meta interface RequiresApprovingReviews: githubv4.NewBoolean(githubv4.Boolean(data.RequiresApprovingReviews)), RequiresCodeOwnerReviews: githubv4.NewBoolean(githubv4.Boolean(data.RequiresCodeOwnerReviews)), RequiresCommitSignatures: githubv4.NewBoolean(githubv4.Boolean(data.RequiresCommitSignatures)), + RequiresLinearHistory: githubv4.NewBoolean(githubv4.Boolean(data.RequiresLinearHistory)), RequiresStatusChecks: githubv4.NewBoolean(githubv4.Boolean(data.RequiresStatusChecks)), RequiresStrictStatusChecks: githubv4.NewBoolean(githubv4.Boolean(data.RequiresStrictStatusChecks)), RestrictsPushes: githubv4.NewBoolean(githubv4.Boolean(data.RestrictsPushes)), diff --git a/github/resource_github_branch_protection_test.go b/github/resource_github_branch_protection_test.go index 04f9f3c67f..ebe074b517 100644 --- a/github/resource_github_branch_protection_test.go +++ b/github/resource_github_branch_protection_test.go @@ -39,6 +39,9 @@ func TestAccGithubBranchProtection(t *testing.T) { resource.TestCheckResourceAttr( "github_branch_protection.test", "require_signed_commits", "false", ), + resource.TestCheckResourceAttr( + "github_branch_protection.test", "required_linear_history", "false", + ), resource.TestCheckResourceAttr( "github_branch_protection.test", "required_status_checks.#", "0", ),