diff --git a/engine/api/workflowv0/workflow.go b/engine/api/workflowv0/workflow.go index 1f0d1d0615..4eb4e1e190 100644 --- a/engine/api/workflowv0/workflow.go +++ b/engine/api/workflowv0/workflow.go @@ -545,7 +545,7 @@ func getChild(db gorp.SqlExecutor, parent *sdk.CDPipeline, user *sdk.User, branc } func getRemoteOpts(remoteFilter, repoFullName string) pipeline.ExecOptionFunc { - if remoteFilter == "" || (repoFullName != "" && remoteFilter == repoFullName) { + if repoFullName != "" && (remoteFilter == "" || remoteFilter == repoFullName) { return pipeline.LoadPipelineBuildOpts.WithEmptyRemote(repoFullName) } else if repoFullName != "" && remoteFilter != "" { return pipeline.LoadPipelineBuildOpts.WithRemoteName(remoteFilter)