diff --git a/pkg/model/workflow.go b/pkg/model/workflow.go index 21582b06..05d210b6 100644 --- a/pkg/model/workflow.go +++ b/pkg/model/workflow.go @@ -84,6 +84,7 @@ type Job struct { RawContainer yaml.Node `yaml:"container"` Defaults Defaults `yaml:"defaults"` Outputs map[string]string `yaml:"outputs"` + Uses string `yaml:"uses"` Result string } diff --git a/pkg/runner/runner.go b/pkg/runner/runner.go index 105227b2..f846d961 100644 --- a/pkg/runner/runner.go +++ b/pkg/runner/runner.go @@ -116,6 +116,8 @@ func New(runnerConfig *Config) (Runner, error) { return runner, nil } +// NewPlanExecutor ... +//nolint:gocyclo func (runner *runnerImpl) NewPlanExecutor(plan *model.Plan) common.Executor { maxJobNameLen := 0 @@ -128,6 +130,11 @@ func (runner *runnerImpl) NewPlanExecutor(plan *model.Plan) common.Executor { for r, run := range stage.Runs { stageExecutor := make([]common.Executor, 0) job := run.Job() + + if job.Uses != "" { + return fmt.Errorf("reusable workflows are currently not supported (see https://github.com/nektos/act/issues/826 for updates)") + } + if job.Strategy != nil { strategyRc := runner.newRunContext(run, nil) if err := strategyRc.NewExpressionEvaluator().EvaluateYamlNode(&job.Strategy.RawMatrix); err != nil { diff --git a/pkg/runner/runner_test.go b/pkg/runner/runner_test.go index 2094837b..1dcded36 100644 --- a/pkg/runner/runner_test.go +++ b/pkg/runner/runner_test.go @@ -123,6 +123,7 @@ func TestRunEvent(t *testing.T) { {"testdata", "uses-composite", "push", "", platforms, ""}, {"testdata", "uses-composite-with-error", "push", "Job 'failing-composite-action' failed", platforms, ""}, {"testdata", "uses-nested-composite", "push", "", platforms, ""}, + {"testdata", "uses-workflow", "push", "reusable workflows are currently not supported (see https://github.com/nektos/act/issues/826 for updates)", platforms, ""}, {"testdata", "composite-fail-with-output", "push", "", platforms, ""}, {"testdata", "issue-597", "push", "", platforms, ""}, {"testdata", "issue-598", "push", "", platforms, ""}, diff --git a/pkg/runner/testdata/uses-workflow/push.yml b/pkg/runner/testdata/uses-workflow/push.yml new file mode 100644 index 00000000..855dacfe --- /dev/null +++ b/pkg/runner/testdata/uses-workflow/push.yml @@ -0,0 +1,9 @@ +on: push + +jobs: + reusable-workflow: + uses: nektos/act-tests/.github/workflows/reusable-workflow.yml@master + with: + username: mona + secrets: + envPATH: ${{ secrets.envPAT }}