Trim space on title (#75)

Resolves #74

Reviewed-on: https://gitea.com/gitea/changelog/pulls/75
Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com>
Reviewed-by: silverwind <silverwind@noreply.gitea.io>
Co-authored-by: jolheiser <john.olheiser@gmail.com>
Co-committed-by: jolheiser <john.olheiser@gmail.com>
This commit is contained in:
jolheiser 2023-03-21 09:54:34 +08:00 committed by Lunny Xiao
parent 374ea1ab46
commit cbd80881bc
2 changed files with 4 additions and 2 deletions

View File

@ -6,6 +6,7 @@ package service
import (
"fmt"
"strings"
"time"
"code.gitea.io/sdk/gitea"
@ -92,7 +93,7 @@ func getGiteaTagURL(c *gitea.Client, baseURL, owner, repo, mileName, gitTag, fro
func convertToEntry(issue gitea.Issue) Entry {
entry := Entry{
Index: issue.Index,
Title: issue.Title,
Title: strings.TrimSpace(issue.Title),
}
labels := make([]Label, len(issue.Labels))

View File

@ -9,6 +9,7 @@ import (
"fmt"
"net/http"
"os"
"strings"
"time"
"github.com/google/go-github/v50/github"
@ -58,7 +59,7 @@ func (gh *GitHub) Generate() (string, []Entry, error) {
for _, pr := range result.Issues {
if pr.IsPullRequest() == isPull {
p := Entry{
Title: pr.GetTitle(),
Title: strings.TrimSpace(pr.GetTitle()),
Index: int64(pr.GetNumber()),
}