-
Notifications
You must be signed in to change notification settings - Fork 343
feat: add assignees to create-pull-request for fallback issues
#24966
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
Changes from all commits
0d68a4d
0c395a0
48e6e96
76261ab
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,6 +21,7 @@ type CreatePullRequestsConfig struct { | |
| Labels []string `yaml:"labels,omitempty"` | ||
| AllowedLabels []string `yaml:"allowed-labels,omitempty"` // Optional list of allowed labels. If omitted, any labels are allowed (including creating new ones). | ||
| Reviewers []string `yaml:"reviewers,omitempty"` // List of users/bots to assign as reviewers to the pull request | ||
| Assignees []string `yaml:"assignees,omitempty"` // List of users to assign to any fallback issue created by create-pull-request | ||
| Draft *string `yaml:"draft,omitempty"` // Pointer to distinguish between unset (nil), literal bool, and expression values | ||
| IfNoChanges string `yaml:"if-no-changes,omitempty"` // Behavior when no changes to push: "warn" (default), "error", or "ignore" | ||
| AllowEmpty *string `yaml:"allow-empty,omitempty"` // Allow creating PR without patch file or with empty patch (useful for preparing feature branches) | ||
|
|
@@ -63,6 +64,14 @@ func (c *Compiler) parsePullRequestsConfig(outputMap map[string]any) *CreatePull | |
| createPRLog.Printf("Converted single reviewer string to array before unmarshaling") | ||
| } | ||
| } | ||
| // Pre-process the assignees field to convert single string to array BEFORE unmarshaling | ||
| if assignees, exists := configData["assignees"]; exists { | ||
| if assigneeStr, ok := assignees.(string); ok { | ||
| // Convert single string to array | ||
| configData["assignees"] = []string{assigneeStr} | ||
| createPRLog.Printf("Converted single assignee string to array before unmarshaling") | ||
| } | ||
| } | ||
|
Comment on lines
+67
to
+74
|
||
| } | ||
|
|
||
| // Pre-process the expires field (convert to hours before unmarshaling) | ||
|
|
||
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.
assigneeswas added to the emitted handler config, but there is no unit test asserting it is present/serialized correctly (there is one forreviewersinpkg/workflow/compiler_safe_outputs_config_test.go). Please add a similar test forassigneesto prevent regressions.