fix: only set web_commit_signoff_required if explicitly configured#3165
fix: only set web_commit_signoff_required if explicitly configured#3165steveteuber wants to merge 6 commits 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 |
98629a4 to
6944501
Compare
|
Please rebase 😬 |
stevehipwell
left a comment
There was a problem hiding this comment.
@steveteuber please take a look at the code for allow_forking & vulnerability_alerts which do what you're looking to achieve here.
|
|
||
| // only configure web commit signoff if explicitly set in the configuration | ||
| if webCommitSignoffRequired, ok := d.GetOkExists("web_commit_signoff_required"); ok { //nolint:staticcheck,SA1019 // We sometimes need to use GetOkExists for booleans | ||
| if val, ok := webCommitSignoffRequired.(bool); ok { |
There was a problem hiding this comment.
This code isn't doing what you think it is, ok is always going to be true.
Resolves #2077
Before the change?
The GitHub API 2022-11-28 version has a bug that causes a 422 error when updating a repository within an organization that has "Require sign off on web-based commits" enabled. This is because the API does not allow the
web_commit_signoff_requiredfield to be sent in the update request when the organization has this setting enabled.After the change?
The user has to explicitly set the
web_commit_signoff_requiredfield in the repository configuration to enable or disable it. If the field is not set in the configuration, it will not be sent in the update request, which avoids the 422 error when an organization has "Require sign off on web-based commits" enabled.Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!