There are different categories of moral evaluation and a (roughly) corresponding terminology.* We can either evaluate the agent's motives and the agent's action together or separately. When we separate them, we do admit (1) that people can do the morally right thing for a morally bad reason (e.g. motive of jealousy or revenge) and (2) that people can do the morally wrong thing for a morally good reason (e.g. they act from the desire to do what's right, but are mistaken about the facts of the situation).
____________
* This is nicely laid out in Peter Glassen, "The Classes of Moral Terms", Methodos, Vol. 11 (1959) 223-244. A free pdf can be downloaded here:
Not surprisingly, the relation of action and intention has always been one of the most problematic issues in contemporary philosophy. To understand Intentionality , we need first to learn what representation is and the key to understanding representation is related to the conditions of satisfaction. As such, all Intentional statements about certain world realities which have a direction of fit represent their conditions of satisfaction. For instance, "President Trump is a republican" , the conditions of satisfaction of my belief is that Trump is a republican which in turn satisfies intentionality object because the Intentional object is Trump. By contrast statements like " the king of France is bald " lacks they intentionality criteria. Consequently, there are some like Picasso who believe that actions are more important than intentions. By contrast, in the Islamic tradition, intentions are superior to what one does .
Though it is often stated that actions are the best indicator of intentions, though both are or perhaps should be linked the link is not as direct. I would hope that most would wish to act from noble and ethical intentions, particularly when we discuss religions and professions but this might not be obvious. In fact, herein lies the ethical flaw at only looking at the consequences/results of one’s actions without delving deep into the intentions behind the actions. Also, in a court of law despite the burden of proof, the judge is required to be convinced about the intentions. So, of course there is a connection - the fun in life us working out what it is!!
An action or way of doing something or working towards anything should be based on the intention one has for that action to be carried out, which becomes visible , once we act upon any task given to us. So there is a direct connection between intention and what you do. A good intention always leads to a good outcome, maybe not immediately always but its there at the end of the task. However a bad intention definitely shows the output of a task too. A connection of the two must be understood and implemented for every thing we do in our lives.
No that is not a given. Ousting a dictator like Sadam or Gadhaffi might be a morally right action, but the motivation behind it was pure economical and had nothing to do with morality. Drive and action can come from opposite sides clearly.