From 1e72c594aca1854854d40a24f3e038537f392fc8 Mon Sep 17 00:00:00 2001 From: Markus Wolf Date: Wed, 11 May 2022 21:30:18 +0200 Subject: [PATCH] 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> --- pkg/model/workflow.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/model/workflow.go b/pkg/model/workflow.go index 05d210b..cca2049 100644 --- a/pkg/model/workflow.go +++ b/pkg/model/workflow.go @@ -414,6 +414,10 @@ const ( // Type returns the type of the step func (s *Step) Type() StepType { + if s.Run == "" && s.Uses == "" { + return StepTypeInvalid + } + if s.Run != "" { if s.Uses != "" { return StepTypeInvalid