✨ feat(tui): 状态评论改用隐藏格式读写,已知字段改从 schema 派生
This commit is contained in:
1 parent
9d1bb06f38
commit
a23c88e812
5 files changed
+423
-50
No files matched your search
@@ -2,7 +2,6 @@ package issue
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
@@ -136,8 +135,11 @@ func buildIssue(
|
||||
// When no state blob exists, fall back to issue.state and seed a comment.
|
||||
if col == "" {
|
||||
col = defaultColumn(raw.State)
|
||||
seed, _ := json.Marshal(map[string]string{"column": string(col)})
|
||||
if _, err := client.PostIssueComment(ctx, owner, repo, raw.Number, string(seed)); err != nil {
|
||||
seed, err := FormatStateComment(map[string]any{"column": string(col)})
|
||||
if err == nil {
|
||||
_, err = client.PostIssueComment(ctx, owner, repo, raw.Number, seed)
|
||||
}
|
||||
if err != nil {
|
||||
log.Printf("[superwork] failed to seed state comment on %s/%s#%d: %v", owner, repo, raw.Number, err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user