fix: crash malformed composite action (#1616)

* fix: crash malformed composite action

* Add remote composite action test

---------

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
ChristopherHX
2023-02-23 22:16:07 +00:00
committed by GitHub
parent 4b56aced15
commit 53095d76f4
4 changed files with 43 additions and 2 deletions

View File

@@ -503,7 +503,10 @@ func runPreStep(step actionStep) common.Executor {
step.getCompositeRunContext(ctx)
}
return step.getCompositeSteps().pre(ctx)
if steps := step.getCompositeSteps(); steps != nil && steps.pre != nil {
return steps.pre(ctx)
}
return fmt.Errorf("missing steps in composite action")
default:
return nil
@@ -592,7 +595,10 @@ func runPostStep(step actionStep) common.Executor {
return err
}
return step.getCompositeSteps().post(ctx)
if steps := step.getCompositeSteps(); steps != nil && steps.post != nil {
return steps.post(ctx)
}
return fmt.Errorf("missing steps in composite action")
default:
return nil