A little-noticed amendment passed in the waning moments of this year's congressional session could force publisher Rupert Murdoch to sell the New York Post by March and the Boston Herald by June.

The language, included in the huge government spending bill, prohibits the Federal Communications Commission from repealing or modifying its newspaper-television cross-ownership rule, or from extending any current waivers.

The cross-ownership rule prohibits anyone from owning a radio or TV station and a daily newspaper that serve the same area. The language in the spending bill, however, refers only to TV stations.

The FCC has been considering a petition asking the commission to scrap the rule on the grounds that it is constitutionally suspect and that it is no longer needed because of the proliferation of broadcast stations.

The Freedom of Expression Foundation, a media-funded research group that filed the petition, said the rule is actually exacerbating the decline in the number of daily newspapers in the country.

Foundation President Craig Smith had said when the petition was filed that it was not intended to help Murdoch, but was aimed at sustaining the newspaper industry and particularly independent newspapers.

The FCC asked for public comment on the petition and comments were due last week. Among the groups filing comments were the National Association of Broadcasters and the American Newspaper Publishers Association, both of which were against the rule when it was adopted by the FCC in 1975 and still oppose it.

Murdoch's News America Corp. intended to file comments, said company spokesman Peter Rosenthal, but he declined to characterize Murdoch's position on the issue and would not comment on the bill.

Murdoch said later in a statement issued in New York: "We have been actively seeking buyers for the Post for several weeks and are currently in negotiations. No decisions have been reached about Boston."

The language included in the legislation signed by President Reagan refers only to television stations. The FCC has no pending waivers of the rule except those granted to Murdoch, giving him until March to sell the Post and June to sell the Herald.