The House has approved legislation to prevent a government shutdown at the end of the month and give the Pentagon some relief from a cash crunch that's harming military readiness.