A spending bill to avert a partial government shutdown narrowly cleared a key procedural hurdle in the Senate, paving the way for passage as a midnight Friday deadline loomed.