Sahih Muslim , Hadith 2990

Abu Huraira reported Allah's Messenger as saying: All the people of my Ummah would get pardon for their sins except those who publicise them. And (it means) that a servant should do a deed during the night and tell the people in the morning that he has done so and so, whereas Allah has concealed it. And he does a deed during the day and when it is night he tells the people, whereas Allah has concealed it. Zuhair has used the word hijar for publicising.

حَدَّثَنِي زُهَيْرُ بْنُ حَرْبٍ، وَمُحَمَّدُ بْنُ حَاتِمٍ، وَعَبْدُ بْنُ حُمَيْدٍ، قَالَ عَبْدٌ حَدَّثَنِي وَقَالَ، الآخَرَانِ حَدَّثَنَا يَعْقُوبُ بْنُ إِبْرَاهِيمَ، حَدَّثَنَا ابْنُ أَخِي ابْنِ شِهَابٍ، عَنْ عَمِّهِ، قَالَ قَالَ سَالِمٌ سَمِعْتُ أَبَا هُرَيْرَةَ، يَقُولُ سَمِعْتُ رَسُولَ اللَّهِ صلى الله عليه وسلم يَقُولُ ‏"‏ كُلُّ أُمَّتِي مُعَافَاةٌ إِلاَّ الْمُجَاهِرِينَ وَإِنَّ مِنَ الإِجْهَارِ أَنْ يَعْمَلَ الْعَبْدُ بِاللَّيْلِ عَمَلاً ثُمَّ يُصْبِحُ قَدْ سَتَرَهُ رَبُّهُ فَيَقُولُ يَا فُلاَنُ قَدْ عَمِلْتُ الْبَارِحَةَ كَذَا وَكَذَا وَقَدْ بَاتَ يَسْتُرُهُ رَبُّهُ فَيَبِيتُ يَسْتُرُهُ رَبُّهُ وَيُصْبِحُ يَكْشِفُ سِتْرَ اللَّهِ عَنْهُ ‏"‏ ‏.‏ قَالَ زُهَيْرٌ ‏"‏ وَإِنَّ مِنَ الْهِجَارِ ‏"‏ ‏.‏

sunnah.com