I am assuming the friend is not a Catholic marrying in a Protestant church without a dispensation (which in any event would preclude him from receiving their communion.) In that event, I wouldn’t think it sinful (it’s not YOUR fault they’re not Catholic, right?) so long as YOU do not receive (which is bound to raise some questions and open the door to some evangelization, right?)
My husband was asked to be best man at a Protestant friend’s wedding… both bride and groom cradle Protestants (Church of Christ.) Since there were no impediments to a valid marriage, he was permitted to participate (even though it took place on Holy Saturday~very strange to us Catholics!) It was just a wedding ceremony, no communion, but we (husband, son and I) and two other guests were the only Catholics, but I don’t think anyone even realized until we “blew our cover” at the reception by making the sign of the cross before the meal blessing was said! Even so, no one said anything (to us), but the groom got a couple of sideways glances from his pastor, so I’m sure HE had a lot of explaining to do!
Still, if you’re concerned, talk to a priest about it. That’s what my husband did before accepting the role of best man!