Some people might say that, but much stronger and natural is keeping it all in the past tense.
"I just did what was right."
Or, you could avoid the problem entirely and just say this:
"I just did the right thing."
Hope this helps!
- For Teachers