You should never specify API keys anywhere in your code or env files for GCP or AWS.
https://cloud.google.com/docs/authentication/application-def...
You still risk checking in your env file.
Doing it the correct way, your config is in your home directory locally far away from your repo and it finds the configuration automatically when running on GCP.
Even better when developing locally is assign environment variables to temporary access keys.
I’m being handwavy because I’m not a GCP guy. But on AWS, you do something similar by using “aws config” locally and using the IAM role attached to the VM, Lambda, etc so you never need to deploy with access keys.
This isn’t meant to be an “AWS does it better comment”. It looks like from my brief research, something similar is also best practice with GCP.