diff --git a/engine/api/workflow/dao.go b/engine/api/workflow/dao.go index d8304ffbd6..7b22ad56ed 100644 --- a/engine/api/workflow/dao.go +++ b/engine/api/workflow/dao.go @@ -1297,7 +1297,7 @@ func Push(ctx context.Context, db *gorp.DbMap, store cache.Store, proj *sdk.Proj // If a old workflow as code exists, we want to check if the new workflow is also as code on the same repository if oldWf != nil && oldWf.FromRepository != "" { // If no repository info are given but force option is set, allow workflow override - if (opts == nil || opts.FromRepository == "") && !opts.Force { + if opts == nil || (opts.FromRepository == "" && !opts.Force) { return nil, nil, nil, nil, sdk.WithStack(sdk.ErrWorkflowAlreadyAsCode) } // Force option will not allow to change the repository of an existing workflow