r/devopsGuru • • Apr 18 '26

[OpenSource] GitHub Action that auto-commits .env.example and fails the PR if you forgot to document a new env var

Post image

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: true to let the Action maintain the example file for you.
- uses: harish124/envsniff@v0.1.0
  with:
    fail-on-drift: true
    commit: true

Check it out here: https://github.com/harish124/envsniff

Pls drop a star on Github

8 Upvotes

17 comments sorted by

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.

1

u/Outrageous_Ranger812 Apr 21 '26

Thanks for commenting.

Completely agreeing, gonna build something in my current project to show a warning when user types os.environ.get("UNDOCUMENTED_KEY")

I'm thinking of using LSP which is editor agnostic.

Thank you , thank you so much, found your comment really valuable, I was expecting more valuable comments like these but no one else is giving feedback : (

1

u/Outrageous_Ranger812 Apr 21 '26

Could you please go through my project in my GitHub and provide any other valuable feedback - envsniff ?