Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions pkg/runner/run_context.go
Original file line number Diff line number Diff line change
Expand Up @@ -757,15 +757,19 @@
var executor common.Executor
var jobType, err = rc.Run.Job().Type()

switch jobType {
case model.JobTypeDefault:
executor = newJobExecutor(rc, &stepFactoryImpl{}, rc)
case model.JobTypeReusableWorkflowLocal:
executor = newLocalReusableWorkflowExecutor(rc)
case model.JobTypeReusableWorkflowRemote:
executor = newRemoteReusableWorkflowExecutor(rc)
case model.JobTypeInvalid:
return nil, err
if exec, ok := rc.Config.CustomExecutor[jobType]; ok {
executor = exec(rc)

Check warning on line 761 in pkg/runner/run_context.go

View check run for this annotation

Codecov / codecov/patch

pkg/runner/run_context.go#L761

Added line #L761 was not covered by tests
} else {
switch jobType {
case model.JobTypeDefault:
executor = newJobExecutor(rc, &stepFactoryImpl{}, rc)
case model.JobTypeReusableWorkflowLocal:
executor = newLocalReusableWorkflowExecutor(rc)
case model.JobTypeReusableWorkflowRemote:
executor = newRemoteReusableWorkflowExecutor(rc)
case model.JobTypeInvalid:
return nil, err

Check warning on line 771 in pkg/runner/run_context.go

View check run for this annotation

Codecov / codecov/patch

pkg/runner/run_context.go#L770-L771

Added lines #L770 - L771 were not covered by tests
}
}

return func(ctx context.Context) error {
Expand Down
2 changes: 2 additions & 0 deletions pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ type Config struct {
ContainerNetworkMode docker_container.NetworkMode // the network mode of job containers (the value of --network)
ActionCache ActionCache // Use a custom ActionCache Implementation
HostEnvironmentDir string // Custom folder for host environment, parallel jobs must be 1

CustomExecutor map[model.JobType]func(*RunContext) common.Executor // Custom executor to run jobs
}

func (runnerConfig *Config) GetGitHubServerURL() string {
Expand Down