Allow gitea bot as trigger user

This commit is contained in:
Lunny Xiao
2022-11-17 17:59:47 +08:00
committed by Jason Song
parent 110072a8d4
commit f4bbd534b9
2 changed files with 19 additions and 7 deletions

View File

@ -49,7 +49,11 @@ func (runs RunList) LoadTriggerUser() error {
return err
}
for _, run := range runs {
run.TriggerUser = users[run.TriggerUserID]
if run.TriggerUserID == user_model.BotUserID {
run.TriggerUser = user_model.NewBotUser()
} else {
run.TriggerUser = users[run.TriggerUserID]
}
}
return nil
}