How to cause the build to fail if .env file has missing variables compared to .env.example file?

I want the build to fail if there are missing .env variables compared to .env.example variables. Is there a way to check this? Value need not be checked, but, the key needs to be present.

System Information
  • Strapi Version: 4.2.0