Force login when user id differs
continuous-integration/drone/push Build is passing Details

This commit is contained in:
nemunaire 2022-09-16 14:41:48 +02:00
parent 9351b39a4b
commit dca7d00cfd
1 changed files with 9 additions and 1 deletions

View File

@ -350,11 +350,19 @@ func TriggerTagUpdate(c *gin.Context, work *Work, repo *Repository, u *User, tag
repo_tag = *tag
}
login := u.Login
if u.Id != repo.IdUser {
user, _ := getUser(int(repo.IdUser))
if user != nil {
login = user.Login
}
}
client := drone.NewClient(droneEndpoint, droneConfig)
result, err := client.BuildCreate("srs", "atsebay.t-worker", "", "master", map[string]string{
"REPO_URL": repo.URI,
"REPO_TAG": repo_tag,
"LOGIN": u.Login,
"LOGIN": login,
"DEST": fmt.Sprintf("%d", work.Id),
})
if err != nil {