提交id截取固定长度
Some checks failed
代码更新通知 / update-server (push) Failing after 1s

This commit is contained in:
2024-12-18 16:46:32 +08:00
parent bd5614c4e6
commit 244b5da60d
3 changed files with 7 additions and 2 deletions

View File

@@ -3,6 +3,7 @@ package main
import (
"encoding/json"
"fmt"
"github.com/duke-git/lancet/v2/strutil"
"github.com/golang-cz/devslog"
"github.com/gotify/go-api-client/v2/auth"
"github.com/gotify/go-api-client/v2/client/message"
@@ -134,7 +135,7 @@ func getExtraMsg(ctx *githubactions.GitHubContext) (result string) {
var commits []string
for _, v := range event.Commits {
commits = append(commits, fmt.Sprintf("- %s [%s](%s)", v.Message, v.Id, v.Url))
commits = append(commits, fmt.Sprintf("- %s [%s](%s)", v.Message, strutil.Substring(v.Id, 0, 6), v.Url))
}
action := fmt.Sprintf("%s/%s/actions/runs/%d", ctx.ServerURL, ctx.Repository, ctx.RunNumber)