diff --git a/pkg/parser/parser.go b/pkg/parser/parser.go index 6a947e64..dda7b778 100644 --- a/pkg/parser/parser.go +++ b/pkg/parser/parser.go @@ -110,7 +110,6 @@ func (p *Parser) parseTasks(tree *node.Node) ([]task.ParseableTaskLike, error) { } taskLike.SetID(p.NextTaskID()) - taskLike.SetIndexWithinBuild(p.NextTaskLocalIndex()) // Set task's name if not set in the definition if taskLike.Name() == "" { @@ -133,6 +132,8 @@ func (p *Parser) parseTasks(tree *node.Node) ([]task.ParseableTaskLike, error) { continue } + taskLike.SetIndexWithinBuild(p.NextTaskLocalIndex()) + tasks = append(tasks, taskLike) } }