I was actually able to get this working in the Pre-Deployment Test UX using this package https://www.npmjs.com/package/dotenv which I found via https://stackoverflow.com/a/75493151/6146641 - Then just add your .env file with GCLOUD_PROJECT="PROJECT_ID" and call require('dotenv').config() in your function.