diff --git a/engine/api/v2_workflow_run_craft.go b/engine/api/v2_workflow_run_craft.go index 7eb9dab6e2..646920f85e 100644 --- a/engine/api/v2_workflow_run_craft.go +++ b/engine/api/v2_workflow_run_craft.go @@ -167,6 +167,13 @@ func (api *API) craftWorkflowRunV2(ctx context.Context, id string) error { } run.Contexts = *runContext wref := NewWorkflowRunEntityFinder(*p, *run, *repo, *vcsServer, *u, run.AdminMFA, api.Config.WorkflowV2.LibraryProjectKey) + plugins, err := plugin.LoadAllByType(ctx, api.mustDB(), sdk.GRPCPluginAction) + if err != nil { + return err + } + for _, p := range plugins { + wref.ef.plugins[p.Name] = p + } // Resolve workflow template if applicable if run.WorkflowData.Workflow.From != "" { @@ -254,14 +261,6 @@ func (api *API) craftWorkflowRunV2(ctx context.Context, id string) error { wref.run = *run } - plugins, err := plugin.LoadAllByType(ctx, api.mustDB(), sdk.GRPCPluginAction) - if err != nil { - return err - } - for _, p := range plugins { - wref.ef.plugins[p.Name] = p - } - allVariableSets, err := project.LoadVariableSetsByProject(ctx, api.mustDB(), p.Key) if err != nil { return err diff --git a/tests/08_v2_workflow_template.yml b/tests/08_v2_workflow_template.yml index ba299be20d..48fb9e4e04 100644 --- a/tests/08_v2_workflow_template.yml +++ b/tests/08_v2_workflow_template.yml @@ -74,6 +74,7 @@ testcases: model: "{{.worker_model}}" memory: "512" steps: + - uses: actions/checkout - run: |- #!/bin/bash env