Disable gh telemetry when running integration tests (#5587)

This prevents a file `test/.local/state/gh/device-id` from appearing in
the working copy after running integration tests locally.
This commit is contained in:
Stefan Haller 2026-05-06 09:50:37 +02:00 committed by GitHub
commit 6ed87bd5e4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -61,5 +61,10 @@ func NewTestEnvironment(rootDir string) []string {
// versions >= 2.32.0
env = append(env, fmt.Sprintf("%s=%s", GIT_CONFIG_GLOBAL_ENV_VAR, globalGitConfigPath(rootDir)))
// Disable gh telemetry. It was enabled by default in gh 2.91.0, and
// this would cause gh config files to be left in the working tree
// (e.g. `test/.local/state/gh/device-id`).
env = append(env, "GH_TELEMETRY=disabled")
return env
}