“Beware of practicing your righteousness before other people in order to be seen by them, for then you will have no reward from your Father who is in heaven. “Thus, when you give to the needy, sound no trumpet before you, as the hypocrites do in the synagogues and in the streets, that they may be praised by others. Truly, I say to you, they have received their reward. But when you give to the needy, do not let your left hand know what your right hand is doing, so that your giving may be in secret. And your Father who sees in secret will reward you.” (Matthew 6:1–4, ESV)
It’s not a problem if people discover your good works.
It’s only a problem if you are the one doing the revealing.
In other words, practicing righteousness is for the glory of God and the benefit of others.
It’s not for the glory of me and the benefit of my reputation.