mirror of
https://github.com/go-gitea/gitea.git
synced 2025-06-23 06:28:01 +02:00
Avoid user does not exist error when detecting schedule actions when the commit author is an external user (#30357)
 When repo is a mirror, and commit author is an external user, then `GetUserByEmail` will return error. reproduce/test: - mirror Gitea to your instance - disable action and enable it again, this will trigger `DetectAndHandleSchedules` ps: also follow #24706, it only fixed normal runs, not scheduled runs.
This commit is contained in:
@ -40,6 +40,9 @@ func (schedules ScheduleList) LoadTriggerUser(ctx context.Context) error {
|
||||
schedule.TriggerUser = user_model.NewActionsUser()
|
||||
} else {
|
||||
schedule.TriggerUser = users[schedule.TriggerUserID]
|
||||
if schedule.TriggerUser == nil {
|
||||
schedule.TriggerUser = user_model.NewGhostUser()
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user