(45) باب قَوْلِهِ صلى الله عليه وسلم " إِنَّمَا الأَعْمَالُ بِالنِّيَّةِ." وَأَنَّهُ يَدْخُلُ فِيهِ الْغَزْوُ وَغَيْرُهُ مِنَ الأَعْمَالِ
It has been narrated through a different chain of transmitters on the authority of Sufyan who said that he heard 'Umar b. al-Khattab relate (this tradition) from the Prophet (ﷺ) while he was delivering a sermon from the pulpit. (DE)
Reference (DE): Sahih Muslim 1907 b (DE)
In-book reference (DE): Book 33, Hadith 223 (DE)
USC-MSA web (English) reference(deprecated numbering scheme): Book 20, Hadith 4693 (DE)