Backport pipeline: always initialize required request fields into ce/main (#11481)

* pipeline: always initialize required request fields (#11478)
* make fmt

Signed-off-by: Ryan Cragun <me@ryan.ec>
Co-authored-by: Ryan Cragun <me@ryan.ec>
This commit is contained in:
Vault Automation 2025-12-18 11:47:50 -07:00 committed by GitHub
parent 91025c9ce7
commit 09a2166d56
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -79,17 +79,17 @@ func newCreateGithubBackportCmd() *cobra.Command {
func runCreateGithubBackportCmd(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true // Don't spam the usage on failure
for i, ig := range createGithubBackportState.ceAllowInactive {
if i == 0 && createGithubBackportState.req.CEAllowInactiveGroups == nil {
createGithubBackportState.req.CEAllowInactiveGroups = changed.FileGroups{}
}
if createGithubBackportState.req.CEAllowInactiveGroups == nil {
createGithubBackportState.req.CEAllowInactiveGroups = changed.FileGroups{}
}
for _, ig := range createGithubBackportState.ceAllowInactive {
createGithubBackportState.req.CEAllowInactiveGroups = createGithubBackportState.req.CEAllowInactiveGroups.Add(changed.FileGroup(ig))
}
for i, eg := range createGithubBackportState.ceExclude {
if i == 0 && createGithubBackportState.req.CEExclude == nil {
createGithubBackportState.req.CEExclude = changed.FileGroups{}
}
if createGithubBackportState.req.CEExclude == nil {
createGithubBackportState.req.CEExclude = changed.FileGroups{}
}
for _, eg := range createGithubBackportState.ceExclude {
createGithubBackportState.req.CEExclude = createGithubBackportState.req.CEExclude.Add(changed.FileGroup(eg))
}