Michigan publisher John P. McGoff, who unsuccessfully tried to buy the Washington Star five years ago, was ordered by a judge today to answer under oath questions about his alleged used of secret South African government funds to purchase American newspapers.

The action by U.S. District Court Judge Charles Renfrew came after McGoff refused to obey an earlier court order that he provide information on the source of funds he used to purchase the Sacramento Bee had requested the information in conjunction with an antitrust case involving the Union and the Bee that is pending in federal court here.

The Bee's request came after a South African government commission last April charged that McGoff had been provided covertly with $11.5 million by the government in 1974 to purchase foreign newspapers. The effort was part of a multimillion-dollar secret propaganda campaign by the South African government aimed at gaining influence abroad, according to the commission.

According to today's court order, McGoff and another officer of his publishing company must answer questions and provide by August documents, records and correspondense about the source of funds used in attempting to buy the Union and the Star. The court also levied a $10,000 fine against McGoff's attorney for refusing to honor the earlier court order.