fix: return error on reusable workflows (#1093)

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Ryan
2022-03-30 19:20:45 +02:00
committed by GitHub
parent 48db7d9c9d
commit b3bd268e45
4 changed files with 18 additions and 0 deletions

View File

@@ -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 {