Deeds are judged by intention
Hadith 1 of al-Nawawi's Forty: the Arabic as al-Nawawi gives it, a plain English rendering, who narrates it, and where it is reported.
عن أمير المؤمنين أبي حفص عمر بن الخطاب (رضي الله عنه) قال: سمعت رسول الله ﷺ يقول: "إنما الأعمال بالنيات وإنما لكل امرئ ما نوى، فمن كانت هجرته إلى الله ورسوله، فهجرته إلى الله ورسوله، ومن كانت هجرته لدنيا يصيبها أو امرأة ينكحها، فهجرته إلى ما هاجـر إليه". (رواه إماما المحدّثين: أبو عبد الله محمـد بن إسماعيل بن إبراهيم بن المغيرة بن بردزبه البخاري الجعفي، وأبو الحسين مسلم بن الحجاج بن مسلم القشيري النيسابوري في صحيحيهما اللذين هما أصح الكتب المصنفة).
What it says
Deeds are only by intention, and every person has only what they intended. So whoever's migration was for God and His Messenger, their migration was for God and His Messenger; and whoever's migration was for some worldly thing to be had, or a woman to be married, their migration was for what they migrated to.
- Narrated from
- Umar ibn al-Khattab
- Reported in
- al-Bukhari and Muslim
- Subject
- Intention
- Grading
- In al-Bukhari or Muslim, where inclusion is itself the grading; no grader is named for such a hadith.
The attribution names: Sahih al-Bukhari, Sahih Muslim.