Abu Dharr reported,

Someone said to the Messenger of Allah ﷺ, "What do you think of a man who does a good deed and people praise him for it?"He replied, "That is the immediate good tidings for the believer."In another wording, "and people love him for it" instead of "and people praise him for it."

Azami 14669

Sahih

عن أبي ذر قال

قيل لرسول الله ﷺ: أرأيت الرجل يعمل العمل من الخير، ويحمده الناس عليه؟ قال: تلك عاجل بشرى المؤمن. وفي لفظ: ويحبه الناس عليه بدل ويحمده الناس عليه.

الأعظمي 14669صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Superior moral conduct
Chapter
Etiquette of speech, words, and correspondence
Section
When a righteous man is praised it is glad tidings and does not harm him
Numbering
Jami al-Kamil 14669 (2nd edition)
Azami 14669