Virtual user gitea-bots

This commit is contained in:
Lunny Xiao
2022-11-25 17:48:46 +08:00
committed by Jason Song
parent 1e209973ee
commit 339ddf4c5f
3 changed files with 26 additions and 17 deletions
+16
View File
@@ -0,0 +1,16 @@
// Copyright 2022 The Gitea Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package bots
import user_model "code.gitea.io/gitea/models/user"
// NewBotUser creates and returns a fake user for running the build.
func NewBotUser() *user_model.User {
return &user_model.User{
ID: -2,
Name: "gitea-bots",
LowerName: "gitea-bots",
}
}