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", ),