Force login when user id differs
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
9351b39a4b
commit
dca7d00cfd
@ -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 {
|
||||
|
Reference in New Issue
Block a user