Skip to content

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

Open
ScriptRaccoon wants to merge 1 commit into
mainfrom
check-env
Open

Check that environment variables are up-to-date#274
ScriptRaccoon wants to merge 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.

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