Ibn Abbas (RA) reported Allah's Messenger (ﷺ) as saying: If anyone wants to have his deeds widely publicised, Allah will publicise (his humiliation). And if anyone makes a hypocritical display (of his deeds) Allah will make a display of him.
Hadith Referenceصحيح مسلم / كتاب الزهد والرقائق / 2986