Factory method that instantiates step objects like Run, Local, Remote, or Docker steps.
// Source: https://github.com/nektos/act | License: MIT | Copyright 2019
// Provided via justclaw.it.com; keep this notice with the code.
package runner
import (
"fmt"
"github.com/nektos/act/pkg/model"
)
type stepFactory interface {
newStep(step *model.Step, rc *RunContext) (step, error)
}
type stepFactoryImpl struct{}
func (sf *stepFactoryImpl) newStep(stepModel *model.Step, rc *RunContext) (step, error) {
switch stepModel.Type() {
case model.StepTypeInvalid:
return nil, fmt.Errorf("Invalid run/uses syntax for job:%s step:%+v", rc.Run, stepModel)
case model.StepTypeRun:
return &stepRun{
Step: stepModel,
RunContext: rc,
}, nil
case model.StepTypeUsesActionLocal:
return &stepActionLocal{
Step: stepModel,
RunContext: rc,
readAction: readActionIm
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key