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:
parent
374ea1ab46
commit
cbd80881bc
|
@ -6,6 +6,7 @@ package service
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"code.gitea.io/sdk/gitea"
|
"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 {
|
func convertToEntry(issue gitea.Issue) Entry {
|
||||||
entry := Entry{
|
entry := Entry{
|
||||||
Index: issue.Index,
|
Index: issue.Index,
|
||||||
Title: issue.Title,
|
Title: strings.TrimSpace(issue.Title),
|
||||||
}
|
}
|
||||||
|
|
||||||
labels := make([]Label, len(issue.Labels))
|
labels := make([]Label, len(issue.Labels))
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/google/go-github/v50/github"
|
"github.com/google/go-github/v50/github"
|
||||||
|
@ -58,7 +59,7 @@ func (gh *GitHub) Generate() (string, []Entry, error) {
|
||||||
for _, pr := range result.Issues {
|
for _, pr := range result.Issues {
|
||||||
if pr.IsPullRequest() == isPull {
|
if pr.IsPullRequest() == isPull {
|
||||||
p := Entry{
|
p := Entry{
|
||||||
Title: pr.GetTitle(),
|
Title: strings.TrimSpace(pr.GetTitle()),
|
||||||
Index: int64(pr.GetNumber()),
|
Index: int64(pr.GetNumber()),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue