DO NOT commit the following to version control:
- API keys (Gemini, OpenAI, etc.)
- Tokens (Socrata, GitHub, etc.)
- Database passwords
- Private encryption keys
- AWS/GCP credentials
-
Copy the template:
cp .env.example .env
-
Update with your actual values: Edit
.envwith your real API keys and tokens -
Verify
.envis ignored:git check-ignore .env # Should output: .env
Store secrets in GitHub Secrets instead:
- Go to: Settings → Secrets and variables → Actions
- Add your secrets there
- Reference in workflows as:
${{ secrets.YOUR_SECRET_NAME }}
Example:
env:
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
SOCRATA_APP_TOKEN: ${{ secrets.SOCRATA_APP_TOKEN }}IMMEDIATELY:
- Revoke/regenerate the exposed credentials
- Clean Git history using
git-filter-repoorBFG Repo-Cleaner - Force push:
git push --force-with-lease
# Example using BFG (recommended for beginners)
bfg --delete-files .env
git reflog expire --expire=now --all && git gc --prune=now
git push --force-with-leaseLast updated: 2026-06-02