Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,5 @@ jobs:
go-version-file: go.mod
cache: true
- run: make tools
- run: make lintcheck
- run: make website-lint
- run: make build
- run: make test
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
version: "2"

run:
allow-serial-runners: true

linters:
default: none

Expand Down
9 changes: 2 additions & 7 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ endif
default: build

tools:
go install github.com/client9/misspell/cmd/misspell@v0.3.4
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.6.0
go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.10.1

build: lintcheck
CGO_ENABLED=0 go build -ldflags="-s -w" ./...
Expand Down Expand Up @@ -73,15 +72,11 @@ ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)

website-lint:
@echo "==> Checking website against linters..."
@misspell -error -source=text website/

website-test:
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)

.PHONY: build test testacc fmt lint lintcheck tools website website-lint website-test sweep
.PHONY: build test testacc fmt lint lintcheck tools website website-test sweep
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Terraform Provider GitHub
# Terraform Provider GitHub
=========================

<img src="https://cloud.githubusercontent.com/assets/98681/24211275/c4ebd04e-0ee8-11e7-8606-061d656a42df.png" width="72" height="">
Expand All @@ -9,8 +9,8 @@ This project is used to manipulate GitHub resources (repositories, teams, files,

## Requirements

- [Terraform](https://www.terraform.io/downloads.html) 0.10.x
- [Go](https://golang.org/doc/install) 1.24.x (to build the provider plugin)
- [Terraform](https://www.terraform.io/downloads.html) 1.14.x
- [Go](https://golang.org/doc/install) 1.26.x (to build the provider plugin)

## Usage

Expand Down
2 changes: 1 addition & 1 deletion github/data_source_github_branch_protection_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func dataSourceGithubBranchProtectionRulesRead(ctx context.Context, d *schema.Re
if !query.Repository.BranchProtectionRules.PageInfo.HasNextPage {
break
}
variables["cursor"] = githubv4.NewString(query.Repository.BranchProtectionRules.PageInfo.EndCursor)
variables["cursor"] = new(query.Repository.BranchProtectionRules.PageInfo.EndCursor)
}

d.SetId(string(query.Repository.ID))
Expand Down
2 changes: 1 addition & 1 deletion github/data_source_github_organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func dataSourceGithubOrganizationRead(ctx context.Context, d *schema.ResourceDat
if !query.Organization.MembersWithRole.PageInfo.HasNextPage {
break
}
variables["after"] = githubv4.NewString(query.Organization.MembersWithRole.PageInfo.EndCursor)
variables["after"] = new(query.Organization.MembersWithRole.PageInfo.EndCursor)
}

_ = d.Set("repositories", repoList)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func dataSourceGithubOrganizationExternalIdentitiesRead(ctx context.Context, d *
if !query.Organization.SamlIdentityProvider.PageInfo.HasNextPage {
break
}
variables["after"] = githubv4.NewString(query.Organization.SamlIdentityProvider.PageInfo.EndCursor)
variables["after"] = new(query.Organization.SamlIdentityProvider.PageInfo.EndCursor)
}

d.SetId(name)
Expand Down
2 changes: 1 addition & 1 deletion github/data_source_github_organization_ip_allow_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func dataSourceGithubOrganizationIpAllowListRead(ctx context.Context, d *schema.
if !query.Organization.IpAllowListEntries.PageInfo.HasNextPage {
break
}
variables["entriesCursor"] = githubv4.NewString(query.Organization.IpAllowListEntries.PageInfo.EndCursor)
variables["entriesCursor"] = new(query.Organization.IpAllowListEntries.PageInfo.EndCursor)
}
for index := range ipAllowListEntries {
ipAllowList = append(ipAllowList, map[string]any{
Expand Down
2 changes: 1 addition & 1 deletion github/data_source_github_organization_teams.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func dataSourceGithubOrganizationTeamsRead(ctx context.Context, d *schema.Resour
if !query.Organization.Teams.PageInfo.HasNextPage {
break
}
variables["cursor"] = githubv4.NewString(query.Organization.Teams.PageInfo.EndCursor)
variables["cursor"] = new(query.Organization.Teams.PageInfo.EndCursor)
}

d.SetId(string(query.Organization.ID))
Expand Down
6 changes: 3 additions & 3 deletions github/resource_github_actions_organization_permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func resourceGithubActionsOrganizationPermissionsCreateOrUpdate(d *schema.Resour
}

if v, ok := d.GetOk("sha_pinning_required"); ok {
actionsPermissions.SHAPinningRequired = github.Ptr(v.(bool))
actionsPermissions.SHAPinningRequired = new(v.(bool))
}

_, _, err = client.Actions.UpdateActionsPermissions(ctx,
Expand Down Expand Up @@ -313,8 +313,8 @@ func resourceGithubActionsOrganizationPermissionsDelete(d *schema.ResourceData,
_, _, err = client.Actions.UpdateActionsPermissions(ctx,
orgName,
github.ActionsPermissions{
AllowedActions: github.Ptr("all"),
EnabledRepositories: github.Ptr("all"),
AllowedActions: new("all"),
EnabledRepositories: new("all"),
})
if err != nil {
return err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func resourceGithubActionsOrganizationSecretRepositoryCreate(ctx context.Context
repoID := d.Get("repository_id").(int)

repository := &github.Repository{
ID: github.Ptr(int64(repoID)),
ID: new(int64(repoID)),
}

_, err := client.Actions.AddSelectedRepoToOrgSecret(ctx, owner, secretName, repository)
Expand Down Expand Up @@ -120,7 +120,7 @@ func resourceGithubActionsOrganizationSecretRepositoryDelete(ctx context.Context
repoID := d.Get("repository_id").(int)

repository := &github.Repository{
ID: github.Ptr(int64(repoID)),
ID: new(int64(repoID)),
}
_, err := client.Actions.RemoveSelectedRepoFromOrgSecret(ctx, owner, secretName, repository)
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions github/resource_github_actions_organization_variable.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ func resourceGithubActionsOrganizationVariableCreate(ctx context.Context, d *sch
variable := &github.ActionsVariable{
Name: varName,
Value: d.Get("value").(string),
Visibility: github.Ptr(visibility),
SelectedRepositoryIDs: github.Ptr(repoIDs),
Visibility: new(visibility),
SelectedRepositoryIDs: new(repoIDs),
}
_, err := client.Actions.CreateOrgVariable(ctx, owner, variable)
if err != nil {
Expand Down Expand Up @@ -193,8 +193,8 @@ func resourceGithubActionsOrganizationVariableUpdate(ctx context.Context, d *sch
variable := &github.ActionsVariable{
Name: varName,
Value: d.Get("value").(string),
Visibility: github.Ptr(visibility),
SelectedRepositoryIDs: github.Ptr(repoIDs),
Visibility: new(visibility),
SelectedRepositoryIDs: new(repoIDs),
}

_, err := client.Actions.UpdateOrgVariable(ctx, owner, variable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func resourceGithubActionsOrganizationVariableRepositoryCreate(ctx context.Conte
repoID := d.Get("repository_id").(int)

repository := &github.Repository{
ID: github.Ptr(int64(repoID)),
ID: new(int64(repoID)),
}

_, err := client.Actions.AddSelectedRepoToOrgVariable(ctx, owner, variableName, repository)
Expand Down Expand Up @@ -120,7 +120,7 @@ func resourceGithubActionsOrganizationVariableRepositoryDelete(ctx context.Conte
repoID := d.Get("repository_id").(int)

repository := &github.Repository{
ID: github.Ptr(int64(repoID)),
ID: new(int64(repoID)),
}
_, err := client.Actions.RemoveSelectedRepoFromOrgVariable(ctx, owner, variableName, repository)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ resource "github_actions_organization_variable" "test" {
_, err = client.Actions.CreateOrgVariable(ctx, owner, &github.ActionsVariable{
Name: varName,
Value: "test",
Visibility: github.Ptr("all"),
Visibility: new("all"),
})
return err
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ func resourceGithubActionsOrganizationWorkflowPermissionsCreateOrUpdate(ctx cont
workflowPerms := github.DefaultWorkflowPermissionOrganization{}

if v, ok := d.GetOk("default_workflow_permissions"); ok {
workflowPerms.DefaultWorkflowPermissions = github.Ptr(v.(string))
workflowPerms.DefaultWorkflowPermissions = new(v.(string))
}

if v, ok := d.GetOk("can_approve_pull_request_reviews"); ok {
workflowPerms.CanApprovePullRequestReviews = github.Ptr(v.(bool))
workflowPerms.CanApprovePullRequestReviews = new(v.(bool))
}

tflog.Debug(ctx, "Calling GitHub API to update workflow permissions", map[string]any{
Expand Down Expand Up @@ -194,8 +194,8 @@ func resourceGithubActionsOrganizationWorkflowPermissionsDelete(ctx context.Cont

// Reset to safe defaults
workflowPerms := github.DefaultWorkflowPermissionOrganization{
DefaultWorkflowPermissions: github.Ptr("read"),
CanApprovePullRequestReviews: github.Ptr(false),
DefaultWorkflowPermissions: new("read"),
CanApprovePullRequestReviews: new(false),
}

tflog.Debug(ctx, "Using safe default values", map[string]any{
Expand Down
4 changes: 2 additions & 2 deletions github/resource_github_actions_repository_access_level.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func resourceGithubActionsRepositoryAccessLevelCreateOrUpdate(d *schema.Resource

accessLevel := d.Get("access_level").(string)
actionAccessLevel := github.RepositoryActionsAccessLevel{
AccessLevel: github.Ptr(accessLevel),
AccessLevel: new(accessLevel),
}

_, err := client.Repositories.EditActionsAccessLevel(ctx, owner, repoName, actionAccessLevel)
Expand Down Expand Up @@ -81,7 +81,7 @@ func resourceGithubActionsRepositoryAccessLevelDelete(d *schema.ResourceData, me
ctx := context.WithValue(context.Background(), ctxId, repoName)

actionAccessLevel := github.RepositoryActionsAccessLevel{
AccessLevel: github.Ptr("none"),
AccessLevel: new("none"),
}
_, err := client.Repositories.EditActionsAccessLevel(ctx, owner, repoName, actionAccessLevel)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func resourceGithubActionsRepositoryOIDCSubjectClaimCustomizationTemplateDelete(
owner := meta.(*Owner).name

customOIDCSubjectClaimTemplate := &github.OIDCSubjectClaimCustomTemplate{
UseDefault: github.Ptr(true),
UseDefault: new(true),
}

ctx := context.Background()
Expand Down
6 changes: 3 additions & 3 deletions github/resource_github_actions_repository_permissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func resourceGithubActionsRepositoryPermissionsCreateOrUpdate(d *schema.Resource
}

if v, ok := d.GetOk("sha_pinning_required"); ok {
repoActionPermissions.SHAPinningRequired = github.Ptr(v.(bool))
repoActionPermissions.SHAPinningRequired = new(v.(bool))
}

_, _, err := client.Repositories.UpdateActionsPermissions(ctx,
Expand Down Expand Up @@ -236,8 +236,8 @@ func resourceGithubActionsRepositoryPermissionsDelete(d *schema.ResourceData, me

// Reset the repo to "default" settings
repoActionPermissions := github.ActionsPermissionsRepository{
AllowedActions: github.Ptr("all"),
Enabled: github.Ptr(true),
AllowedActions: new("all"),
Enabled: new(true),
}

_, _, err := client.Repositories.UpdateActionsPermissions(ctx,
Expand Down
92 changes: 46 additions & 46 deletions github/resource_github_branch_protection.go
Original file line number Diff line number Diff line change
Expand Up @@ -232,30 +232,30 @@ func resourceGithubBranchProtectionCreate(d *schema.ResourceData, meta any) erro
data.BypassPullRequestActorIDs = bypassPullRequestIds

input := githubv4.CreateBranchProtectionRuleInput{
AllowsDeletions: githubv4.NewBoolean(githubv4.Boolean(data.AllowsDeletions)),
AllowsForcePushes: githubv4.NewBoolean(githubv4.Boolean(data.AllowsForcePushes)),
BlocksCreations: githubv4.NewBoolean(githubv4.Boolean(data.BlocksCreations)),
BypassForcePushActorIDs: githubv4NewIDSlice(githubv4IDSliceEmpty(data.BypassForcePushActorIDs)),
BypassPullRequestActorIDs: githubv4NewIDSlice(githubv4IDSliceEmpty(data.BypassPullRequestActorIDs)),
DismissesStaleReviews: githubv4.NewBoolean(githubv4.Boolean(data.DismissesStaleReviews)),
IsAdminEnforced: githubv4.NewBoolean(githubv4.Boolean(data.IsAdminEnforced)),
AllowsDeletions: new(githubv4.Boolean(data.AllowsDeletions)),
AllowsForcePushes: new(githubv4.Boolean(data.AllowsForcePushes)),
BlocksCreations: new(githubv4.Boolean(data.BlocksCreations)),
BypassForcePushActorIDs: new(githubv4IDSliceEmpty(data.BypassForcePushActorIDs)),
BypassPullRequestActorIDs: new(githubv4IDSliceEmpty(data.BypassPullRequestActorIDs)),
DismissesStaleReviews: new(githubv4.Boolean(data.DismissesStaleReviews)),
IsAdminEnforced: new(githubv4.Boolean(data.IsAdminEnforced)),
Pattern: githubv4.String(data.Pattern),
PushActorIDs: githubv4NewIDSlice(githubv4IDSlice(data.PushActorIDs)),
RepositoryID: githubv4.NewID(githubv4.ID(data.RepositoryID)),
RequiredApprovingReviewCount: githubv4.NewInt(githubv4.Int(data.RequiredApprovingReviewCount)),
RequiredStatusCheckContexts: githubv4NewStringSlice(githubv4StringSliceEmpty(data.RequiredStatusCheckContexts)),
RequiresApprovingReviews: githubv4.NewBoolean(githubv4.Boolean(data.RequiresApprovingReviews)),
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)),
RestrictsReviewDismissals: githubv4.NewBoolean(githubv4.Boolean(data.RestrictsReviewDismissals)),
ReviewDismissalActorIDs: githubv4NewIDSlice(githubv4IDSlice(data.ReviewDismissalActorIDs)),
LockBranch: githubv4.NewBoolean(githubv4.Boolean(data.LockBranch)),
RequireLastPushApproval: githubv4.NewBoolean(githubv4.Boolean(data.RequireLastPushApproval)),
PushActorIDs: new(githubv4IDSlice(data.PushActorIDs)),
RepositoryID: new(githubv4.ID(data.RepositoryID)),
RequiredApprovingReviewCount: new(githubv4.Int(data.RequiredApprovingReviewCount)),
RequiredStatusCheckContexts: new(githubv4StringSliceEmpty(data.RequiredStatusCheckContexts)),
RequiresApprovingReviews: new(githubv4.Boolean(data.RequiresApprovingReviews)),
RequiresCodeOwnerReviews: new(githubv4.Boolean(data.RequiresCodeOwnerReviews)),
RequiresCommitSignatures: new(githubv4.Boolean(data.RequiresCommitSignatures)),
RequiresConversationResolution: new(githubv4.Boolean(data.RequiresConversationResolution)),
RequiresLinearHistory: new(githubv4.Boolean(data.RequiresLinearHistory)),
RequiresStatusChecks: new(githubv4.Boolean(data.RequiresStatusChecks)),
RequiresStrictStatusChecks: new(githubv4.Boolean(data.RequiresStrictStatusChecks)),
RestrictsPushes: new(githubv4.Boolean(data.RestrictsPushes)),
RestrictsReviewDismissals: new(githubv4.Boolean(data.RestrictsReviewDismissals)),
ReviewDismissalActorIDs: new(githubv4IDSlice(data.ReviewDismissalActorIDs)),
LockBranch: new(githubv4.Boolean(data.LockBranch)),
RequireLastPushApproval: new(githubv4.Boolean(data.RequireLastPushApproval)),
}

ctx := context.Background()
Expand Down Expand Up @@ -406,29 +406,29 @@ func resourceGithubBranchProtectionUpdate(d *schema.ResourceData, meta any) erro

input := githubv4.UpdateBranchProtectionRuleInput{
BranchProtectionRuleID: d.Id(),
AllowsDeletions: githubv4.NewBoolean(githubv4.Boolean(data.AllowsDeletions)),
AllowsForcePushes: githubv4.NewBoolean(githubv4.Boolean(data.AllowsForcePushes)),
BlocksCreations: githubv4.NewBoolean(githubv4.Boolean(data.BlocksCreations)),
BypassForcePushActorIDs: githubv4NewIDSlice(githubv4IDSliceEmpty(data.BypassForcePushActorIDs)),
BypassPullRequestActorIDs: githubv4NewIDSlice(githubv4IDSliceEmpty(data.BypassPullRequestActorIDs)),
DismissesStaleReviews: githubv4.NewBoolean(githubv4.Boolean(data.DismissesStaleReviews)),
IsAdminEnforced: githubv4.NewBoolean(githubv4.Boolean(data.IsAdminEnforced)),
Pattern: githubv4.NewString(githubv4.String(data.Pattern)),
PushActorIDs: githubv4NewIDSlice(githubv4IDSlice(data.PushActorIDs)),
RequiredApprovingReviewCount: githubv4.NewInt(githubv4.Int(data.RequiredApprovingReviewCount)),
RequiredStatusCheckContexts: githubv4NewStringSlice(githubv4StringSliceEmpty(data.RequiredStatusCheckContexts)),
RequiresApprovingReviews: githubv4.NewBoolean(githubv4.Boolean(data.RequiresApprovingReviews)),
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)),
RestrictsReviewDismissals: githubv4.NewBoolean(githubv4.Boolean(data.RestrictsReviewDismissals)),
ReviewDismissalActorIDs: githubv4NewIDSlice(githubv4IDSlice(data.ReviewDismissalActorIDs)),
LockBranch: githubv4.NewBoolean(githubv4.Boolean(data.LockBranch)),
RequireLastPushApproval: githubv4.NewBoolean(githubv4.Boolean(data.RequireLastPushApproval)),
AllowsDeletions: new(githubv4.Boolean(data.AllowsDeletions)),
AllowsForcePushes: new(githubv4.Boolean(data.AllowsForcePushes)),
BlocksCreations: new(githubv4.Boolean(data.BlocksCreations)),
BypassForcePushActorIDs: new(githubv4IDSliceEmpty(data.BypassForcePushActorIDs)),
BypassPullRequestActorIDs: new(githubv4IDSliceEmpty(data.BypassPullRequestActorIDs)),
DismissesStaleReviews: new(githubv4.Boolean(data.DismissesStaleReviews)),
IsAdminEnforced: new(githubv4.Boolean(data.IsAdminEnforced)),
Pattern: new(githubv4.String(data.Pattern)),
PushActorIDs: new(githubv4IDSlice(data.PushActorIDs)),
RequiredApprovingReviewCount: new(githubv4.Int(data.RequiredApprovingReviewCount)),
RequiredStatusCheckContexts: new(githubv4StringSliceEmpty(data.RequiredStatusCheckContexts)),
RequiresApprovingReviews: new(githubv4.Boolean(data.RequiresApprovingReviews)),
RequiresCodeOwnerReviews: new(githubv4.Boolean(data.RequiresCodeOwnerReviews)),
RequiresCommitSignatures: new(githubv4.Boolean(data.RequiresCommitSignatures)),
RequiresConversationResolution: new(githubv4.Boolean(data.RequiresConversationResolution)),
RequiresLinearHistory: new(githubv4.Boolean(data.RequiresLinearHistory)),
RequiresStatusChecks: new(githubv4.Boolean(data.RequiresStatusChecks)),
RequiresStrictStatusChecks: new(githubv4.Boolean(data.RequiresStrictStatusChecks)),
RestrictsPushes: new(githubv4.Boolean(data.RestrictsPushes)),
RestrictsReviewDismissals: new(githubv4.Boolean(data.RestrictsReviewDismissals)),
ReviewDismissalActorIDs: new(githubv4IDSlice(data.ReviewDismissalActorIDs)),
LockBranch: new(githubv4.Boolean(data.LockBranch)),
RequireLastPushApproval: new(githubv4.Boolean(data.RequireLastPushApproval)),
}

ctx := context.WithValue(context.Background(), ctxId, d.Id())
Expand Down
2 changes: 1 addition & 1 deletion github/resource_github_branch_protection_v3_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
func buildProtectionRequest(d *schema.ResourceData) (*github.ProtectionRequest, error) {
req := &github.ProtectionRequest{
EnforceAdmins: d.Get("enforce_admins").(bool),
RequiredConversationResolution: github.Ptr(d.Get("require_conversation_resolution").(bool)),
RequiredConversationResolution: new(d.Get("require_conversation_resolution").(bool)),
}

rsc, err := expandRequiredStatusChecks(d)
Expand Down
Loading