-
Notifications
You must be signed in to change notification settings - Fork 54
Repo-local git config ignores cloud template environment variables, uses account-derived identity instead #870
Description
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.comBut .git/config contains different, account-derived values:
[user]
name = user
email = user@example.comRoot 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/configwith 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)