The Messenger of Allah ﷺ said, "Whoever makes others hear of his deeds, Allah will make others hear of him, and whoever shows off his deeds, Allah will expose him."
حدثنا وكيع وعبد الرحمن قالا حدثنا سفيان عن سلمة بن كهيل قال سمعت جندبا يقول قال
قال رسول الله ﷺ من يسمع يسمع الله به ومن يراء يراء الله به
No references are available.
Its isnad is sahih, and it is found in Bukhari 11/335, no. 6499, Fath, in the Book of Riqaq, chapter on riya and showing off, and Muslim 4/2281, no. 2987, in the Book of Zuhd, chapter on the one who associates something else in his deed.