diff --git a/pkg/runner/reusable_workflow.go b/pkg/runner/reusable_workflow.go index 2e97bdf..e9c7bbe 100644 --- a/pkg/runner/reusable_workflow.go +++ b/pkg/runner/reusable_workflow.go @@ -17,6 +17,18 @@ import ( ) func newLocalReusableWorkflowExecutor(rc *RunContext) common.Executor { + if !rc.Config.NoSkipCheckout { + fullPath := rc.Run.Job().Uses + + fileName := path.Base(fullPath) + workflowDir := strings.TrimSuffix(fullPath, path.Join("/", fileName)) + workflowDir = strings.TrimPrefix(workflowDir, "./") + + return common.NewPipelineExecutor( + newReusableWorkflowExecutor(rc, workflowDir, fileName), + ) + } + // ./.gitea/workflows/wf.yml -> .gitea/workflows/wf.yml trimmedUses := strings.TrimPrefix(rc.Run.Job().Uses, "./") // uses string format is {owner}/{repo}/.{git_platform}/workflows/{filename}@{ref} diff --git a/pkg/runner/run_context.go b/pkg/runner/run_context.go index 13b0765..898e47a 100644 --- a/pkg/runner/run_context.go +++ b/pkg/runner/run_context.go @@ -82,6 +82,11 @@ func (rc *RunContext) GetEnv() map[string]string { } } rc.Env["ACT"] = "true" + + if !rc.Config.NoSkipCheckout { + rc.Env["ACT_SKIP_CHECKOUT"] = "true" + } + return rc.Env }