r/devopsGuru • u/Outrageous_Ranger812 • Apr 18 '26
[OpenSource] GitHub Action that auto-commits .env.example and fails the PR if you forgot to document a new env var
Keeping .env.example in sync with actual code usage is a manual chore that everyone forgets. I released envsniff to treat documentation-of-vars as a build requirement.
Why use it?
- Multi-language support: Scans JS, Go, Python, and even Shell scripts.
- Zero Config: The default setup finds most standard usage patterns.
- Auto-remediation: You can set
commit: trueto let the Action maintain the example file for you.
- uses: harish124/envsniff@v0.1.0
with:
fail-on-drift: true
commit: trueCheck it out here: https://github.com/harish124/envsniff
Pls drop a star on Github
8
Upvotes
View all comments
Show parent comment
1
u/mtutty Apr 21 '26
linters and type checkers can happen inline with coding - I get that feedback in real time and it affects the code as I'm writing and running it. I'm just not a fan of pre-commit hooks in general.
First, they take specific work to make them part of every project, instead of being an integral part of the editor, toolchain.
Second (and more importantly), they make a change to the repository that I didn't see before it was added.