Skip to content

Commit

Permalink
fix: scan branch failed when source type is gitsource (#1024)
Browse files Browse the repository at this point in the history
  • Loading branch information
yudong2015 committed Nov 20, 2023
1 parent e33901e commit 6b65524
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/kapis/devops/v1alpha3/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,12 @@ func (h *devopsHandler) CreatePipeline(request *restful.Request, response *restf
return
}

// fix: scan branch failed when source type is gitsource
if pipeline.IsMultiBranch() && pipeline.Spec.MultiBranchPipeline.GitSource != nil {
pipeline.Spec.MultiBranchPipeline.GitSource.DiscoverBranches = true
pipeline.Spec.MultiBranchPipeline.GitSource.DiscoverTags = true
}

if client, err := h.getDevOps(request); err == nil {
created, err := client.CreatePipelineObj(devops, &pipeline)
errorHandle(request, response, created, err)
Expand Down

0 comments on commit 6b65524

Please sign in to comment.