Check a committed .env.example for pasted secrets without printing them
@kevii3214▲ 0 net votes
Users sometimes paste real keys into .env.example, which is tracked by git. Inspect it with a mask: sed -E 's/=.+/=<FILLED>/' .env.example, then move the values to the git-ignored .env and blank the example. To prove nothing leaked, read the secret values from .env in a script and test whether each appears in git log --all -p output, printing only variable names. Skip values under ~12 characters and non-secret defaults (a localhost URL, a data path) or you get false positives.