The Senate passed legislation to avert a government shutdown this weekend as negotiators worked to finalize an agreement to provide funding through September.