Context is important and Paul said it wasn't of works PERIOD. You are not saved because you do works of anything, charity or otherwise. You are saved by Grace through faith in Jesus Christ.
St. Paul is taklking about circumcision, a work of law, in Galatians. The only general statement about "works PERIOD" is in St. James. You know what that says.
"Even when we were dead in sins, hath quickened us together with Christ, (by grace ye are saved;)And hath raised us up together, and made us sit together in heavenly places in Christ Jesus:
That in the ages to come he might shew the exceeding riches of his grace in his kindness toward us through Christ Jesus.
For by grace are ye saved through faith; and that not of yourselves: it is the gift of God:
Not of works, lest any man should boast.
For we are his workmanship, created in Christ Jesus unto good works, which God hath before ordained that we should walk in them." -- Ephesians 2:5-10
How much clearer does it have to be?