Secrets live outside code
A secret in source is in history, diffs, and every fork. Read it from the environment or a secrets file that is gitignored. The code names the secret; the runtime supplies the value. That split is the whole rule.
Rotate after a leak
If a secret ever reached a public repo, deleting the line is not enough, history still holds it. Revoke and issue a new value, then treat the old one as burned. Rotation is the fix, not deletion.