he head of Poland's influential Roman Catholic Church warned against demonstrations getting out of hand on May 1 as Communist authorities and opposition groups pushed yesterday toward a confrontation.

Wading into the political crossfire that threatens to turn the traditional workers' May Day celebration into a battlefield in Poland, Cardinal Jozef Glemp appealed Sunday for peace and prayer on May 1 in remarks before a crowd of 30,000 worshipers in the western city of Gniezno.

The statement, recorded by a daily Catholic paper, was picked up and circulated widely by the officially-controlled Polish press agency PAP. The Warsaw goverment was obviously pleased to have the primate undercutting the protest call issued recently by Poland's leading underground committee.

Glemp, speaking from the balcony of a residence kept by the primate in Gniezno, said, "The church has never determined the way the working people's holiday is celebrated. On the other hand, it is our duty to warn against a danger, for whatever manifestations take place, events not intended by the organizers may occur."

Meanwhile, former Solidarity chairman Lech Walesa, who has tacitly backed independent May Day rallies, signed hundreds of autographs yesterday at the Lenin Shipyard in Gdansk as he came for a medical checkup in preparation for resuming work as an electrician there.

But without waiting for Walesa to get settled in the job and reassert his authority as a labor leader, members of the shipyard's new, unpopular trade union elected a relative unknown, Krzystof Skibicki, as union chairman at a conference