From 77409f4042cba2fb302d17360d87ba54928c8114 Mon Sep 17 00:00:00 2001 From: Jiri Tyr Date: Mon, 13 Dec 2021 18:14:46 +0000 Subject: [PATCH] Adding missing RequiresLinearHistory (#935) Signed-off-by: Jiri Tyr --- 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 9caea1e1a1..9ae9cf11ec 100644 --- a/github/resource_github_branch_protection.go +++ b/github/resource_github_branch_protection.go @@ -158,6 +158,7 @@ func resourceGithubBranchProtectionCreate(d *schema.ResourceData, meta interface RequiresCodeOwnerReviews: githubv4.NewBoolean(githubv4.Boolean(data.RequiresCodeOwnerReviews)), RequiresCommitSignatures: githubv4.NewBoolean(githubv4.Boolean(data.RequiresCommitSignatures)), RequiresConversationResolution: githubv4.NewBoolean(githubv4.Boolean(data.RequiresConversationResolution)), + 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)), @@ -284,6 +285,7 @@ func resourceGithubBranchProtectionUpdate(d *schema.ResourceData, meta interface RequiresCodeOwnerReviews: githubv4.NewBoolean(githubv4.Boolean(data.RequiresCodeOwnerReviews)), RequiresCommitSignatures: githubv4.NewBoolean(githubv4.Boolean(data.RequiresCommitSignatures)), RequiresConversationResolution: githubv4.NewBoolean(githubv4.Boolean(data.RequiresConversationResolution)), + 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 9cfef20810..cb7576d7ac 100644 --- a/github/resource_github_branch_protection_test.go +++ b/github/resource_github_branch_protection_test.go @@ -127,6 +127,9 @@ func TestAccGithubBranchProtection(t *testing.T) { resource.TestCheckResourceAttr( "github_branch_protection.test", "require_conversation_resolution", "true", ), + resource.TestCheckResourceAttr( + "github_branch_protection.test", "required_linear_history", "false", + ), resource.TestCheckResourceAttr( "github_branch_protection.test", "required_status_checks.#", "0", ),