fix: dryrun skip local actions + enable Tests (#1199)

* Update step_action_local.go

* Enable Tests for DRYRUN

* Update runner_test.go

* Update runner_test.go

* Move DRYRUN Test in it's own function

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
ChristopherHX
2022-06-07 16:19:30 +02:00
committed by GitHub
parent 28f5b37fd1
commit b7d380b3f0
2 changed files with 36 additions and 0 deletions

View File

@@ -28,6 +28,9 @@ func (sal *stepActionLocal) pre() common.Executor {
sal.env = map[string]string{}
return func(ctx context.Context) error {
if common.Dryrun(ctx) {
return nil
}
actionDir := filepath.Join(sal.getRunContext().Config.Workdir, sal.Step.Uses)
localReader := func(ctx context.Context) actionYamlReader {
@@ -65,6 +68,9 @@ func (sal *stepActionLocal) pre() common.Executor {
func (sal *stepActionLocal) main() common.Executor {
return runStepExecutor(sal, stepStageMain, func(ctx context.Context) error {
if common.Dryrun(ctx) {
return nil
}
actionDir := filepath.Join(sal.getRunContext().Config.Workdir, sal.Step.Uses)
return sal.runAction(sal, actionDir, nil)(ctx)
})