The Prophet ﷺ said, "Whoever dies without having fought in battle and without having even resolved within himself to fight, dies on a branch of hypocrisy."
أخبرنا عبدة بن عبد الرحيم قال حدثنا سلمة بن سليمان قال أنبأنا ابن المبارك قال أنبأنا وهيب يعني ابن الورد قال أخبرني عمر بن محمد بن المنكدر عن سمي عن أبي صالح
عن النبي ﷺ قال من مات ولم يغز ولم يحدث نفسه بغزو مات على شعبة نفاق
Reported by Muslim, Leadership, chapter on the condemnation of one who died without having fought and without having even entertained the thought of fighting, hadith 1910, from the hadith of Abdullah bin Mubarak with the same wording, and it is in Al-Kubra, hadith 4305.