mirror of
https://github.com/go-gitea/gitea.git
synced 2026-08-12 02:28:37 +00:00
Partially backport #36336 1. correctly parse git protocol's "OldCommit NewCommit RefName" line, it should be explicitly split by space 2. trim space for the "commit status context name" to follow the same behavior of git_model.NewCommitStatus
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
actions_model "code.gitea.io/gitea/models/actions"
|
||||
"code.gitea.io/gitea/models/db"
|
||||
@@ -91,6 +92,7 @@ func createCommitStatus(ctx context.Context, job *actions_model.ActionRunJob) er
|
||||
runName = wfs[0].Name
|
||||
}
|
||||
ctxname := fmt.Sprintf("%s / %s (%s)", runName, job.Name, event)
|
||||
ctxname = strings.TrimSpace(ctxname) // git_model.NewCommitStatus also trims spaces
|
||||
state := toCommitStatus(job.Status)
|
||||
if statuses, err := git_model.GetLatestCommitStatus(ctx, repo.ID, sha, db.ListOptionsAll); err == nil {
|
||||
for _, v := range statuses {
|
||||
|
||||
Reference in New Issue
Block a user