From 09a2166d56d5f26c0bbce5ce72d8354729bb0e54 Mon Sep 17 00:00:00 2001 From: Vault Automation Date: Thu, 18 Dec 2025 11:47:50 -0700 Subject: [PATCH] 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 Co-authored-by: Ryan Cragun --- .../internal/cmd/github_create_backport.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/pipeline/internal/cmd/github_create_backport.go b/tools/pipeline/internal/cmd/github_create_backport.go index 99ba64bb8f..fe6981dc9a 100644 --- a/tools/pipeline/internal/cmd/github_create_backport.go +++ b/tools/pipeline/internal/cmd/github_create_backport.go @@ -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)) }