From 90fd17b148c89569eda74f89926b7d10257c6254 Mon Sep 17 00:00:00 2001 From: hori-ryota Date: Fri, 9 Aug 2024 16:59:12 +0900 Subject: [PATCH] Recompile task after runDeps to reload envs set by deps --- task.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/task.go b/task.go index b183014271..ca4d5efeda 100644 --- a/task.go +++ b/task.go @@ -195,6 +195,13 @@ func (e *Executor) RunTask(ctx context.Context, call *ast.Call) error { if err := e.runDeps(ctx, t); err != nil { return err } + if len(t.Deps) > 0 { + // Recompile the task after running dependencies to reload environment variables from dotenv files which may have been set up during the dependency execution + t, err = e.CompiledTask(call) + if err != nil { + return err + } + } skipFingerprinting := e.ForceAll || (!call.Indirect && e.Force) if !skipFingerprinting {