Fix required workflows for organization rulesets#2253
Closed
o-sama wants to merge 1 commit intointegrations:mainfrom
Closed
Fix required workflows for organization rulesets#2253o-sama wants to merge 1 commit intointegrations:mainfrom
o-sama wants to merge 1 commit intointegrations:mainfrom
Conversation
kfcampbell
reviewed
Jun 17, 2024
|
|
||
| case "workflows": | ||
| var params github.RequiredWorkflowsRuleParameters | ||
| log.Printf("[DEBUG] osama test: %v", v.Parameters) |
Contributor
There was a problem hiding this comment.
Can you remove this before we merge?
kfcampbell
reviewed
Jun 17, 2024
| rule["strict_required_status_checks_policy"] = params.StrictRequiredStatusChecksPolicy | ||
| rulesMap[v.Type] = []map[string]interface{}{rule} | ||
|
|
||
| case "workflows": |
Contributor
There was a problem hiding this comment.
How might this behavior be unit tested?
Contributor
|
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} |
Contributor
There was a problem hiding this comment.
Suggested change
| 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 |
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.
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!