Skip to main content

Practice ยท 2 of 3

Flow Validator

A GitHub Flow session is a list of events: "branch", "commit", "push", "pr", "merge". Write validateFlow(events) returning true only for a valid session: starts with exactly one "branch", at least one "commit" and "push" before the "pr", exactly one "pr", and "merge" last (if present). Order violations => false.

Difficulty: intermediate

Back to lesson: Practice: Branch Naming & Flow โ€” Practice