Trigger CI: Skip topo sort when not transitively invalidating

A simple sort is much cheaper and good enough when not transitively invalidating.