A left-wing terrorist group set off four bombs today at the sites of French companies with South African connections, only hours after a pledge by Prime Minister Laurent Fabius to lead an international "crusade" against apartheid.

Responsibility for the early-morning bomb attacks was claimed by Direct Action, a fringe guerrilla group that previously has attacked NATO targets. It issued a statement accusing France's Socialist government of hypocrisy in its dealings with South Africa. Two persons were slightly injured in the explosions, which left considerable material damage.

The bomb attacks appeared to be an attempt to draw attention to the continuing involvement of French companies in South Africa despite the government's outspoken criticism of the white-minority regime. In July, France became the first West European country to impose an embargo on new investments in South Africa and to withdraw its ambassador from Pretoria.

In a television interview last night, Fabius spoke in emotional terms about South Africa, saying that he had been converted to the wisdom of sanctions following a visit to Paris in May by the Anglican bishop of Johannesburg, Desmond Tutu, and the recent upsurge in communal violence.

Revealing that he promised Tutu to suspend French investments in South Africa in "18 to 24 months" unless the Pretoria government made changes, he said: "That was the position I took in May. Then there was the state of emergency, then they shot on the crowd, and now today they imprison 10-year-old children."

He added: "I don't say that economic sanctions can work miracles, but I do say that when they exclude people because of the color of their skin, when they make them live in ghettos because they are black, . . . when they whip them, then it is the responsibility of France to say 'no' and take the lead in a crusade" against apartheid.

France's decision to impose sanctions against South Africa marked a break with the joint approach adopted by other European Community countries. France did not take part in a fact-finding mission to South Africa by several community foreign ministers this week.

Political analysts noted that the controversy over South Africa has provided the Socialist government with a useful moral issue to stir party activists before important parliamentary elections next March. The Socialists have drifted steadily to the right on both foreign policy and domestic issues since coming to power in May 1981.

In contrast with the United States, where the Reagan administration is under political pressure to take a tougher line toward Pretoria, in France the government seems to be well out in front of public opinion.

There have been far fewer demonstrations and other protests against South Africa here. The French antiapartheid movement, which is comparatively small, has only succeeded in organizing symbolic once-a-month protests outside the South African Embassy here.

"We have difficulty mobilizing the intellectuals here. They are much more interested in human rights problems in Poland and the Soviet Bloc," said Paul Garay, the movement's national secretary.

The pro-Socialist newspaper Le Matin recently devoted several pages to interviews with French intellectuals describing their repugnance with apartheid but going on to explain that they thought it was impossible to change the policies of the Pretoria government. The attitudes of French writers and thinkers traditionally have played an important role in influencing public opinion here.

Although the government has ordered an end to new French investments in South Africa, French economic involvement remains considerable. Existing French investments total more than $1.5 billion, including the country's first nuclear power station at Koeberg, which will continue to acquire its supplies of enriched uranium from France.

One of the firms that worked on installing the Koeberg reactor, SPIE-Batignolles, was among the targets of this morning's bomb attacks by Direct Action. The others were the auto manufacturer Renault, which has an assembly plant near Durban, the state coal importers ATIC, which acquires South African coal, and the Pechiney aluminum company, which imports large quantities of South African minerals.

"The French and South African regimes are ready to do anything to ensure their domination over the peoples they exploit. Let's put a stop to the French accomplices of apartheid," the Direct Action statement said.

The sanctions announced by the French government last July do not affect loans by nationalized French banks to Pretoria for imports of equipment and raw materials. France is South Africa's fifth-largest creditor, behind Britain, the United States, Japan and West Germany.