The House passed the bill before departing ahead of the midterm elections, and President Biden signed it hours before a funding lapse would have forced a government shutdown.