mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-20 04:15:18 +02:00
fix: keep original commit message
This commit is contained in:
parent
ff75cbd81d
commit
326ae5d442
@ -21,7 +21,6 @@ import (
|
|||||||
"code.gitea.io/gitea/modules/json"
|
"code.gitea.io/gitea/modules/json"
|
||||||
"code.gitea.io/gitea/modules/log"
|
"code.gitea.io/gitea/modules/log"
|
||||||
api "code.gitea.io/gitea/modules/structs"
|
api "code.gitea.io/gitea/modules/structs"
|
||||||
"code.gitea.io/gitea/modules/util"
|
|
||||||
"code.gitea.io/gitea/services/convert"
|
"code.gitea.io/gitea/services/convert"
|
||||||
|
|
||||||
"github.com/nektos/act/pkg/jobparser"
|
"github.com/nektos/act/pkg/jobparser"
|
||||||
@ -139,7 +138,7 @@ func notify(ctx context.Context, input *notifyInput) error {
|
|||||||
|
|
||||||
for id, content := range workflows {
|
for id, content := range workflows {
|
||||||
run := actions_model.ActionRun{
|
run := actions_model.ActionRun{
|
||||||
Title: truncateContent(strings.SplitN(commit.CommitMessage, "\n", 2)[0], 255),
|
Title: strings.SplitN(commit.CommitMessage, "\n", 2)[0],
|
||||||
RepoID: input.Repo.ID,
|
RepoID: input.Repo.ID,
|
||||||
OwnerID: input.Repo.OwnerID,
|
OwnerID: input.Repo.OwnerID,
|
||||||
WorkflowID: id,
|
WorkflowID: id,
|
||||||
@ -219,11 +218,3 @@ func notifyPackage(ctx context.Context, sender *user_model.User, pd *packages_mo
|
|||||||
}).
|
}).
|
||||||
Notify(ctx)
|
Notify(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
func truncateContent(content string, n int) string {
|
|
||||||
truncated, omitted := util.SplitStringAtByteN(content, n)
|
|
||||||
if omitted != "" {
|
|
||||||
truncated += "…"
|
|
||||||
}
|
|
||||||
return truncated
|
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user