Kantians, who believe that your motivation is the most important thing in deciding whether you are doing good, and utilitarians, who look only to the outcome of your deeds, not your intent.
In reality, it's a combination of both. Good motivation without addressing the results of your actions can mean unintended suffering. Witness so many of our social welfare laws! Looking at the outcome of deeds without considering why the actions are being taken can wreak horrible suffering. There is a reason why "The ends justify the means" has been closely linked to evil. Two questions are vital: why are we taking action? and what is the likely consequences of taking this action? Sometimes a third question is relevent: what would God think about this? This third question is not to impose religion but to help us be brutally honest with ourselves. For example: We may think that our highest value is compliance with the laws of the land. There is even biblical justification for this in 1 or 2 places. But then we look at the Old Testament concept of welcoming the stranger & treating them fairly that permeates the Old Testament & even impacts inaccurate understandings of New Testament verses, & you see that mercy to the stranger supersedes obeying the laws of the land & should be considered first. The law should be considered after the heart of God in PERSONAL decisions (including protesting treatment of undocumented aliens).