Abu Hurairah: narrated. “Messenger of Allah does not look at your fingers, nor at your attire but he looks at your hearts and accomplishments” [Muslim]
Actions are judged by Intentions.
Everyone will be rewarded or punished according to his aim an intention. Sincerity is the essence of faith and it is what is between you and Allah. No one else can see it. It is a deep feeling rooted inside your heart.
Pure sincerity is striving and fighting in the way of Allah. (Jihad Fi Sabilillah). if the intention of Jihad is present in the heart, you will get rewarded even if you did not participate in it.
Sincerity and good intentions are very important.
[Taken from the book Riyad-us-Saliheen Vol 1]