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 ReferenceSahih Muslim / The Book of Zuhd and Softening of Hearts / Hadith: 2986