God is the Supreme Master of context-sensitivity. God knows, from within their heart, what each person needs -- and responds to it. With that in Mind, He gives us inspirations for the perfect things to do and say for His children. We just have to faithfully follow God's promptings, with the energy, intention, and feeling God gives us for doing them, and surely, our action will be right action.
God's motivations are consistently loving -- because God is love. Divinity is love in action. And as you know, when action is motivated by love, it is right action. Love is God in action.
Even when you follow God's lead, and act from God's love, you may seem to "put your foot in it" occasionally, or seem to get bad results. But even if it isn't well received, every single action inspired by God and love has done good, and will ultimately be beneficial.
Such is the connection between God and Right action.