fix: handle sha_pinning_required=false#3224
Open
sheeeng wants to merge 1 commit intointegrations:mainfrom
Open
fix: handle sha_pinning_required=false#3224sheeeng wants to merge 1 commit intointegrations:mainfrom
sha_pinning_required=false#3224sheeeng wants to merge 1 commit intointegrations:mainfrom
Conversation
|
👋 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 |
Replace d.GetOk() with d.HasChange() || d.IsNewResource() to properly handle boolean false values. The GetOk() method returns ok=false for zero-value booleans, causing sha_pinning_required=false to be silently ignored and never sent to the GitHub API. This fix ensures both true and false values are correctly applied, eliminating perpetual drift when disabling SHA pinning enforcement. Affects github_actions_organization_permissions and github_actions_repository_permissions resources. Fix integrations#3223.
0dee61f to
3067dd7
Compare
sha_pinning_required=falsesha_pinning_required = false
sha_pinning_required = falsesha_pinning_required=false
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Replace
d.GetOk()withd.HasChange() || d.IsNewResource()to properly handle boolean false values. TheGetOk()method returnsok=falsefor zero-value booleans, causingsha_pinning_required = falseto be silently ignored and never sent to the GitHub API.This fix ensures both true and false values are correctly applied, eliminating perpetual drift when disabling SHA pinning enforcement.
The
sha_pinning_requiredoption was introduced in #2870.Affects
github_actions_organization_permissionsandgithub_actions_repository_permissionsresources.Resolve #3223.
Before the change?
sha_pinning_required = falseapplied successfully in Terraform, but not actually changed in GitHub resources itself.After the change?
sha_pinning_required = falseapplied successfully in Terraform, and actually changed in GitHub resources itself.Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!