-
Notifications
You must be signed in to change notification settings - Fork 903
Fix required workflows for organization rulesets #2253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
|
||
| case "workflows": | ||
| var params github.RequiredWorkflowsRuleParameters | ||
| log.Printf("[DEBUG] osama test: %v", v.Parameters) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this before we merge?
| rule["strict_required_status_checks_policy"] = params.StrictRequiredStatusChecksPolicy | ||
| rulesMap[v.Type] = []map[string]interface{}{rule} | ||
|
|
||
| case "workflows": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How might this behavior be unit tested?
|
I do the same in my PR and also fix required_code_scanning |
|
|
||
| rule := make(map[string]interface{}) | ||
| rule["required_workflow"] = requiredWorkflowsSlice | ||
| rulesMap[v.Type] = []map[string]interface{}{rule} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| rulesMap[v.Type] = []map[string]interface{}{rule} | |
| rulesMap["required_workflows"] = []map[string]interface{}{rule} |
you cannot use "v.Type" because it is named required_workflows in the scheme, not workflows. Look in my PR, I also add "do_not_enforce_on_create" to the scheme
|
👋 Hey Friends, this pull request has been automatically marked as |
Resolves #2113
Before the change?
"required_workflows": []in state. This happens because there was no code that flattens this specific rule.After the change?
Pull request checklist
Does this introduce a breaking change?
Please see our docs on breaking changes to help!