fix: return invalid step type (#1157)

If a step does not have either a `run` or `uses` directive it is
considered invalid.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Markus Wolf 2022-05-11 21:30:18 +02:00 committed by GitHub
parent 7879726159
commit 1e72c594ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -414,6 +414,10 @@ const (
// Type returns the type of the step // Type returns the type of the step
func (s *Step) Type() StepType { func (s *Step) Type() StepType {
if s.Run == "" && s.Uses == "" {
return StepTypeInvalid
}
if s.Run != "" { if s.Run != "" {
if s.Uses != "" { if s.Uses != "" {
return StepTypeInvalid return StepTypeInvalid