Planckbaka/dsh-plugin-github-workflows

dsh-plugin-github-workflows

GitHub workflows for DeepSeek Harness (DSH): repos, PRs, issues, commits, releases, Actions, Codespaces, search & raw gh api - one plugin on the GitHub CLI

待分类cordisdeepseek-harnessdsh

dsh-plugin-github-workflows

English | 简体中文

面向 DeepSeek Harness (DSH) 的完整 GitHub 工作流插件,基于 GitHub CLI —— 提交、Pull Request、Issue、Release、Actions、仓库、Codespaces 与搜索,一个零依赖插件搞定:11 个类型化工具、80+ 个动作。

特点

  • 类型化,而非字符串拼接 —— 每个操作都是带 action 枚举的 JSON Schema 工具;命令以 argv 数组构建、不经 shell 执行,模型提供的任何文本都不可能注入 shell 语法;
  • 默认安全 —— 破坏性操作(merge、delete、force-push、rebuild、workflow 触发等)必须显式 confirm: true,配置总开关 allowDestructive 可全局硬禁;
  • 零配置认证 —— 复用 gh 登录、GH_TOKEN,并自动回退到 git 凭证助手里 已存的凭证。能 git push 的机器,插件开箱即用;
  • 零依赖 —— 仅用 Node 内置模块;从 git 仓库或本地目录安装,无需解析、无需构建。

工具一览

工具覆盖
github_auth登录状态、PAT 登录(token 走 stdin,不进日志)、刷新、切换账号
github_repo查看 / 列表 / 创建 / 克隆 / fork / 编辑 / 同步 / 改名 / 归档 / 删除
github_pr创建 / 列表 / 查看 / diff / checks / 评论 / review / 合并 / 关闭 / 重开 / 编辑 / ready / checkout / 状态
github_issue创建 / 列表 / 查看 / 状态 / 评论 / 关闭(带 reason) / 重开 / 编辑 / develop(关联分支)
github_commit只读提交浏览(列表 / 单提交 / compare / 分支),走 GitHub REST API
github_release创建(含自动生成 notes 与资产) / 列表 / 查看 / 上传 / 下载 / 编辑 / 删除
github_actionsrun:列表 / 查看 / 日志 / watch / rerun / cancel / delete;workflow:列表 / 查看 / 手动触发
github_codespace列表 / 创建 / ssh 非交互执行 / cp / code / stop / rebuild / logs / delete
github_search仓库 / issue / PR / 代码 / 提交搜索
github_api任意 REST/GraphQL 请求(逃生舱:label、milestone、project、gist、org…)
github_git本地 git:status / add / commit / push / pull / fetch / branch / log / remote
github_cli原样 gh 透传,默认关闭(allowRaw: true 才注册)

安装

前置:DSH、Node >= 18、 gh CLI、git,以及任意一个认证来源(见下)。

在 DSH 对话中让智能体调用 plugin_manager,或 GUI 设置 → 插件 → 安装插件:

install_bundle → target: github:Planckbaka/dsh-plugin-github-workflows

快速上手

装好后的典型「编码 → PR → CI → 发版」动线:

github_auth       action: status                    ← 确认认证
github_git        action: status                    ← 看改了什么
github_git        action: add      paths: ["src"]
github_git        action: commit   message: "Fix ..."
github_git        action: push     setUpstream: true
github_pr         action: create   title: "Fix ..."  fill: true
github_actions    action: run_watch  runId: <id>     ← 盯 CI 到绿
github_pr         action: merge    mergeMethod: squash, deleteBranch: true, confirm: true
github_release    action: create   tag: v1.1.0, generateNotes: true

认证

插件完全复用已有凭证,自动按顺序回退:

  1. gh 自身已登录(gh auth login 过)→ 直接用;
  2. 环境变量 GH_TOKEN(如 ~/.dsh/.env)→ gh 原生识别;
  3. git 凭证回退 —— gh 未登录时,自动读取 git 凭证助手(GCM / Windows 凭据管理器)中 github.com 的凭证(禁用交互提示)注入为 GH_TOKEN。

也可调用 github_auth(action: setup)用 PAT 显式登录(token 经 stdin, 不进日志)。完整凭证模型见 SECURITY.md。

配置

全部可选 —— 默认值在 lib/index.js;在插件的 config 段覆盖(见 cordis.patch.yml)。

键默认说明
ghPath""gh 可执行文件路径覆盖(默认从 PATH 探测)
gitPath""git 可执行文件路径覆盖(github_git 工具与凭证回退用)
defaultRepo""缺省仓库 owner/name
timeoutMs60000常规命令超时
watchTimeoutMs300000watch/logs 类长操作超时
maxOutputBytes65536输出截断阈值,超出部分写入临时 spill 文件
allowRawfalse是否注册 github_cli 透传工具
allowDestructivetrue破坏性操作总开关
env{}附加环境变量(如 GH_HOST 企业版)

开发

git clone https://github.com/Planckbaka/dsh-plugin-github-workflows.git
npm install --no-save typescript@5 @types/node   # 可选:类型检查
npx tsc --noEmit                                  # JSDoc 类型,零构建
npm test && npm run test:integration

目录结构、dsh-tools JSON Schema 子集规则与完整贡献指南见 CONTRIBUTING.md。

社区规范

贡献指南 · 安全策略 · 行为准则 · 更新日志 · 问题反馈 · 讨论区

许可证

MIT