Skip to content

Commit d5dd799

Browse files
Fix: build error
1 parent f4888c4 commit d5dd799

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

services/webhook/feishu.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,15 @@ import (
99
"crypto/hmac"
1010
"crypto/sha256"
1111
"encoding/base64"
12-
"encoding/json"
1312
"fmt"
1413
"net/http"
14+
"strconv"
1515
"strings"
1616
"time"
1717

1818
webhook_model "code.gitea.io/gitea/models/webhook"
1919
"code.gitea.io/gitea/modules/git"
20+
"code.gitea.io/gitea/modules/json"
2021
api "code.gitea.io/gitea/modules/structs"
2122
webhook_module "code.gitea.io/gitea/modules/webhook"
2223
)
@@ -190,7 +191,7 @@ func (feishuConvertor) WorkflowJob(p *api.WorkflowJobPayload) (FeishuPayload, er
190191
// https://open.feishu.cn/document/client-docs/bot-v3/add-custom-bot
191192
func GenSign(secret string, timestamp int64) (string, error) {
192193
// timestamp + key do sha256, then base64 encode
193-
stringToSign := fmt.Sprintf("%v", timestamp) + "\n" + secret
194+
stringToSign := strconv.FormatInt(timestamp, 10) + "\n" + secret
194195

195196
h := hmac.New(sha256.New, []byte(stringToSign))
196197
_, err := h.Write([]byte{})

0 commit comments

Comments
 (0)