In Factory cloud environments, the repo-local .git/config is always populated with account-derived values, even when the cloud template defines environment variables intended to override the git identity.
Setup
The cloud template defines custom environment variables for git identity and a setup script that applies them:
git -C "${FACTORY_PROJECT_DIR:-$(pwd)}" config user.name "$MY_GIT_NAME"
git -C "${FACTORY_PROJECT_DIR:-$(pwd)}" config user.email "$MY_GIT_EMAIL"
Current behavior
At runtime, the env vars are present and correct:
$ env | grep MY_GIT
MY_GIT_NAME=First Last
MY_GIT_EMAIL=12345678+user@users.noreply.github.com
But .git/config contains different, account-derived values:
[user]
name = user
email = user@example.com
Root cause (from build logs)
The setup script runs during the image build, but the custom template env vars do not appear to be available at that point -- only platform-level vars (FACTORY_API_BASE_URL, ENABLE_SENTRY, FACTORY_ENV) are injected. The repo clone also happens during the build. So either:
- the template env vars are empty during the build-time setup step, or
- a later runtime step overwrites
.git/config with account-derived defaults regardless
Impact
Every commit in a provisioned environment uses the wrong identity. The only workaround is manually running git config each session.
Environment
- Droid v0.89.0
- Linux (Factory cloud environment)
In Factory cloud environments, the repo-local
.git/configis always populated with account-derived values, even when the cloud template defines environment variables intended to override the git identity.Setup
The cloud template defines custom environment variables for git identity and a setup script that applies them:
Current behavior
At runtime, the env vars are present and correct:
$ env | grep MY_GIT MY_GIT_NAME=First Last MY_GIT_EMAIL=12345678+user@users.noreply.github.comBut
.git/configcontains different, account-derived values:Root cause (from build logs)
The setup script runs during the image build, but the custom template env vars do not appear to be available at that point -- only platform-level vars (
FACTORY_API_BASE_URL,ENABLE_SENTRY,FACTORY_ENV) are injected. The repo clone also happens during the build. So either:.git/configwith account-derived defaults regardlessImpact
Every commit in a provisioned environment uses the wrong identity. The only workaround is manually running
git configeach session.Environment