You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: sha_pinning_required = false is silently ignored due to d.GetOk() zero-value bug #3223
Setting sha_pinning_required = false on github_actions_organization_permissions (or github_actions_repository_permissions) should send false to the GitHub API and disable SHA pinning enforcement.
After terraform apply, the state should converge and subsequent terraform plan should show no changes.
Actual Behavior
Setting sha_pinning_required = false is silently ignored. The if v, ok := d.GetOk("sha_pinning_required"); ok guard in resourceGithubActionsOrganizationPermissionsCreateOrUpdate returns ok = false when the value is false (the zero value for bool), so SHAPinningRequired is never set on the API request payload. The GitHub API receives no value and leaves the existing setting unchanged.
This causes perpetual drift: every terraform plan shows sha_pinning_required = true -> false, but terraform apply never actually changes it.
The same bug exists in resource_github_actions_repository_permissions.go with the identical d.GetOk pattern.
Terraform Version
Terraform v1.14.3
on darwin_arm64
+ provider registry.terraform.io/integrations/github v6.11.0
// Bug: d.GetOk() returns ok=false for zero-value bools (false),// so sha_pinning_required=false is never sent to the API.ifv, ok:=d.GetOk("sha_pinning_required"); ok {
actionsPermissions.SHAPinningRequired=github.Ptr(v.(bool))
}
This is the well-known Terraform SDK GetOk + zero-value footgun. A fix would be:
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀
Activity
github-actions commentedon Feb 25, 2026
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with
Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀fix: handle sha_pinning_required=false
fix: handle sha_pinning_required=false
fix: handle sha_pinning_required=false
fix: handle sha_pinning_required=false being silently ignored
fix: handle sha_pinning_required=false
fix: handle sha_pinning_required=false
fix: handle sha_pinning_required=false
fix: handle sha_pinning_required=false
fix: handle sha_pinning_required=false
fix: handle sha_pinning_required=false
fix: handle sha_pinning_required=false
fix: handle sha_pinning_required=false
fix: handle sha_pinning_required=false
fix: handle sha_pinning_required=false
9 remaining items
fix: detect explicit sha_pinning_required=false
fix: detect explicit sha_pinning_required=false
fix: detect explicit sha_pinning_required=false
fix: detect explicit sha_pinning_required=false
stevehipwell commentedon Oct 15, 2026
PR #3682 will fix this for the
github_actions_organization_permissionsresource.