Lawmakers approved a bill averting a government shutdown after weeks of debate in Parliament failed to reach agreement on a new budget.