✨ feat(vscode): webhook 副作用按 assignee 门禁,适配多人协作
This commit is contained in:
@@ -164,7 +164,15 @@ func buildIssueCmd() *cobra.Command {
|
||||
}
|
||||
}
|
||||
rc := fromCtx(cmd)
|
||||
issue, err := rc.Client.CreateIssue(rc.Owner, rc.Repo, icTitle, body)
|
||||
// 创建即认领:assignee=创建人,是插件 webhook 门禁的路由依据。
|
||||
// 身份解析失败不阻塞创建(门禁侧有本地终端兜底)。
|
||||
var assignees []string
|
||||
if login, loginErr := rc.Client.CurrentUserLogin(); loginErr == nil && login != "" {
|
||||
assignees = []string{login}
|
||||
} else if loginErr != nil {
|
||||
fmt.Fprintf(os.Stderr, "警告: 解析当前用户失败,工单将无 assignee: %v\n", loginErr)
|
||||
}
|
||||
issue, err := rc.Client.CreateIssue(rc.Owner, rc.Repo, icTitle, body, assignees)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user