From bbba13501fb212adfff1413fdcb31b83b18bc31f Mon Sep 17 00:00:00 2001 From: j3ssie Date: Mon, 26 Jan 2026 01:52:24 +0800 Subject: [PATCH] fix: ensure loader initialization in server handlers and gh token isolation - Initialize workflow loader in executeRunsConcurrently for proper path resolution - Set loader on all executor instances (CreateRun, StartRun, executeRunsConcurrently) - Unset GH_TOKEN in github-action Makefile target to prevent token conflicts --- Makefile | 2 +- pkg/server/handlers/runs.go | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 34c9b56..f5d1a8c 100644 --- a/Makefile +++ b/Makefile @@ -318,7 +318,7 @@ github-release: export GORELEASER_CURRENT_TAG="$(VERSION)" && goreleaser release --clean github-action: - gh workflow run manual-release.yaml && gh workflow run nightly-release.yaml + unset GH_TOKEN &&gh workflow run manual-release.yaml && gh workflow run nightly-release.yaml # Database commands db-seed: build diff --git a/pkg/server/handlers/runs.go b/pkg/server/handlers/runs.go index 5e961ad..8038bad 100644 --- a/pkg/server/handlers/runs.go +++ b/pkg/server/handlers/runs.go @@ -160,6 +160,8 @@ func executeRunsConcurrently( maxConcurrency = 1 } + loader := parser.NewLoader(cfg.WorkflowsPath) + sem := make(chan struct{}, maxConcurrency) // Semaphore var wg sync.WaitGroup @@ -193,6 +195,7 @@ func executeRunsConcurrently( // Execute workflow exec := executor.NewExecutor() exec.SetServerMode(true) // Enable file logging for server mode + exec.SetLoader(loader) // Set up database progress tracking if runUUID != "" { @@ -370,6 +373,7 @@ func CreateRun(cfg *config.Config) fiber.Handler { exec := executor.NewExecutor() exec.SetServerMode(true) // Enable file logging for server mode + exec.SetLoader(loader) // Set up database progress tracking if run != nil { @@ -782,6 +786,7 @@ func StartRun(cfg *config.Config) fiber.Handler { // Create executor exec := executor.NewExecutor() exec.SetServerMode(true) + exec.SetLoader(loader) exec.SetDBRunUUID(runUUID) exec.SetDBRunID(runID) exec.SetOnStepCompleted(func(stepCtx context.Context, dbRunUUID string) {