Skip to content

Check that environment variables are up-to-date#274

Merged
ScriptRaccoon merged 1 commit into
mainfrom
check-env
Jul 10, 2026
Merged

Check that environment variables are up-to-date#274
ScriptRaccoon merged 1 commit into
mainfrom
check-env

Conversation

@ScriptRaccoon

Copy link
Copy Markdown
Owner

When a new environment variable is added or an existing one is removed, this change is currently only reflected in .env.example, since .env is not tracked in the repository. As a result, contributors may end up with a broken development server without any notification that their local .env file needs to be updated.

This PR adds a check to detect this situation.

Whenever the development server is started, a script verifies that the environment variables defined in .env match those in .env.example. If they differ, an error is thrown with a message asking the developer to update their .env file.

The script intentionally does not run with the test or build commands. These commands run in CI, where no .env file exists; environment variables are provided via GitHub secrets instead.

@ScriptRaccoon

Copy link
Copy Markdown
Owner Author

WDYT @dschepler ? Is this a good solution?

@dschepler

Copy link
Copy Markdown
Contributor

WDYT @dschepler ? Is this a good solution?

It seems fine to me.

@ScriptRaccoon

Copy link
Copy Markdown
Owner Author

Thank you for the feedback. Then I will merge.

@ScriptRaccoon
ScriptRaccoon merged commit fe7231b into main Jul 10, 2026
1 check passed
@ScriptRaccoon
ScriptRaccoon deleted the check-env branch July 10, 2026 07:10
@ScriptRaccoon

ScriptRaccoon commented Jul 11, 2026

Copy link
Copy Markdown
Owner Author

This PR didn't age well ...
In #278 the check is removed again. Reason: All environment variables are now public anyway, so .env can now be in git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants