Skip to content

Commit 528ce32

Browse files
committed
Git identity should not flow from TeamCity agent to docker build.
1 parent 4be542a commit 528ce32

1 file changed

Lines changed: 9 additions & 11 deletions

File tree

DockerBuild.ps1

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -145,19 +145,17 @@ if (-not $KeepEnv)
145145
}
146146

147147
# Add git identity to environment
148-
$env:GIT_USER_EMAIL = git config --global user.email
149-
$env:GIT_USER_NAME = git config --global user.name
150-
151148
if ($env:IS_TEAMCITY_AGENT)
152149
{
153-
if (-not $env:GIT_USER_EMAIL)
154-
{
155-
$env:GIT_USER_EMAIL = 'teamcity@postsharp.net'
156-
}
157-
if (-not $env:GIT_USER_NAME)
158-
{
159-
$env:GIT_USER_NAME = 'teamcity'
160-
}
150+
# On TeamCity agents, use a fixed git user.
151+
$env:GIT_USER_EMAIL = 'teamcity@postsharp.net'
152+
$env:GIT_USER_NAME = 'teamcity'
153+
}
154+
else
155+
{
156+
# On developer machines, use the current git user.
157+
$env:GIT_USER_EMAIL = git config --global user.email
158+
$env:GIT_USER_NAME = git config --global user.name
161159
}
162160

163161
New-EnvJson -EnvironmentVariableList $EnvironmentVariables

0 commit comments

Comments
 (0)