With government paychecks and benefits for millions on the line, the Senate reluctantly gave in yesterday and joined the House in passing a vital government funding resolution.

The action ended a two-week-long, eyeball-to-eyeball confrontation between the House and Senate over the issues of a pay raise for Congress and federal funding for abortion. The substance of the resolution, to continue funding until Nov. 20 for government departments whose appropriations bills have not cleared Congress, was a mere hostage to the fight.

Because essentially the Senate had blinked, giving the House most of what it wanted, the House easily passed the resolution by voice vote earlier in the day.

The House got the 5.5 percent cost-of-living increase for Congress it wanted so badly, and in return it had to modify only slightly its strict antiabortion language. The House wanted federal funding of abortion only where the life of the women was in danger, but it has to accept funding for abortions also in cases of promptly reported rape or incest.

The action also ended agonizing suspense for millions of federal workers and military personnel who were faced with half pay or no pay if the dispute continued into next week.

For about one million employes of the departments of Defense; Labor; Health, Education and Welfare; Interior and Transportation, and the Veterans Administration, it was too late. their checks for half pay already were processed, and, in some cases, handed out. but they will get the other half next week, as fast, as government computers can grind out the checks.

About 1.5 million military personnel, faced with no paychecks Monday if the dispute had continued, will get their pay. All about a few beneficiaries of government programs will get their checks on time.

For about 22,000 high-paid officials in the executive branch and 913 federal judges, the action means a rollback of the 12.9 percent cost-of-living increase they became entitled to Oct. 1 because of Congress inaction. The resolution rolled back the increase to 5.5 percent. Though Congress included judges in the rollbacks, they probably can successfully sue for the full 12.9 percent because the Constitution forbids reducing a judge's salary during his term of office.

President Carter signed the resolution at the White House last night.

When the resolution got to the Senate late yesterday afternoon, senators still were seething over a House tactic of two weeks ago. The House voted then to take the pay raise and to refuse to give at all an abortion funding. It then quickly adjourned for a 10-day recess, leaving the Senate holding the bag. The Senate chose to kill that resolution, rather than accept what the House had passed.

Yesterday, the Senate first decided to do the same thing. It voted 62 to 26 to kill the new resolution, but Rep. Ted Stevens (R-Alaska) argued that the senators would be blamed for the "suffering" of millions, who would know only that Congress was holding up their checks.

With about two dozen House members on the Senate floor lobbying hard for acceptance of the compromise, Stevens and Senate Majority Leader Robert C. Byrd (D-W.Va) were able to get the compromise accepted, 44 to 42.

But the action was not over, Sen. Lowell P. Weicker (R-Conn.) offered an amendment to knock out the pay raise for Congress. The House was using "blackmail" and "holding the government hostage to their pay raise" he said.

Don't give up on principle just because you've got a gun to your head," Weicker argued.

Byrd stepped in and promised that if the Senate went along with the pay raise, he immediately would offer a separate bill to kill it for members of Congress.

The action would be only symbolic, because any such bill sent to the House would never go to the House floor. But the bill would put the Senate on record against the raise.

The vote on the Weicker amendment see-sawed. Finally, just as Weicker was winning, 43 to 42, Sen. John A. Durkin (D-N.H.) switched his vote, and the Weicker amendment was defeated, 43 to 42.

Then the controversial compromise language on abortion was approved, 43 to 41.

The Senate had given up a provision in current law that allows federal funding of abortion where severe and longlasting physical health damage to the woman, as attested to by two physicians, could occur by continuing the pregnancy. Senate liberals who didn't mind the pay raise objected to the stricter abortion language.

Then byrd offered his seperate bill eliminating the pay raise for Congress. It carried 72 to 12.

While the pay issue is now settled, the abortion-funding fight is likely to occur as least four more times, as Congress still must pass appropriations for the District of Columbia, the Defense Department, foreign aid and Labor-HEW, all of which have abortion language in them.