chore: code lint

This commit is contained in:
Jason Song 2022-12-01 15:33:05 +08:00
parent b2745bff43
commit d2a4c10bc7
No known key found for this signature in database
GPG Key ID: 8402EEEE4511A8B5
2 changed files with 4 additions and 4 deletions

View File

@ -91,9 +91,7 @@ func CreateCommitStatus(ctx context.Context, job *bots_model.BotRunJob) error {
ctxname := job.Name
state := toCommitStatus(job.Status)
if statuses, _, err := git_model.GetLatestCommitStatus(ctx, repo.ID, sha, db.ListOptions{}); err != nil {
return fmt.Errorf("GetLatestCommitStatus: %w", err)
} else {
if statuses, _, err := git_model.GetLatestCommitStatus(ctx, repo.ID, sha, db.ListOptions{}); err == nil {
for _, v := range statuses {
if v.Context == ctxname {
if v.State == state {
@ -102,6 +100,8 @@ func CreateCommitStatus(ctx context.Context, job *bots_model.BotRunJob) error {
break
}
}
} else {
return fmt.Errorf("GetLatestCommitStatus: %w", err)
}
if err := git_model.NewCommitStatus(git_model.NewCommitStatusOptions{

View File

@ -420,7 +420,7 @@
</div>
</div>
{{if .EnableBots }}
{{if .EnableBots}}
{{$isBotsEnabled := .Repository.UnitEnabled $.UnitTypeBots}}
<div class="inline field">
<label>{{.locale.Tr "repo.bots"}}</label>