DSH Plugin Store
Back to home

Lixiaoyiao

deepseek-harness-action

Community GitHub Action for DeepSeek Harness — AI Code Review · CI Diagnosis · Auto Fix · Issue → PR

Stars
5
Language
TypeScript
Created
Aug 14, 2026
Updated
Aug 14, 2026
Workspace
GitHub repo

Introduction

DeepSeek Harness for GitHub

CI Release MIT

English

让 GitHub 里的 PR、Issue 和失败 CI 直接调用 DeepSeek Harness。

GitHub PR / Issue / CI  →  DeepSeek Harness  →  Review / Diagnose / Fix / Issue → PR

它和 Claude Code Action 属于同一类 GitHub 集成:由 GitHub 事件启动 coding agent,再把 review、诊断或代码改动写回仓库。这个项目使用的是 DeepSeek Harness。

PR 可以自动收到行内 review;失败的 CI 可以得到诊断;在你明确开放写权限后,@dsh 也可以修代码或把 Issue 做成 PR。

这是由社区维护的项目,不是 DeepSeek 或 GitHub 官方产品。

Maintained by @Lixiaoyiao.

真实运行

下面都是这个仓库自己的公开运行记录,可以直接查看评论和 Actions 日志。

场景运行记录
PR Review,以及复跑不重复发评论PR #3 · Actions run
读取失败 check 和日志后给出诊断Actions run
受信任写模式下修复并验证Actions run
从 Issue 实现代码并创建 PRIssue #4PR #5

快速开始

先在仓库的 Settings → Secrets and variables → Actions 中添加 DEEPSEEK_API_KEY

然后创建 .github/workflows/dsh-review.yml

name: DSH review

on:
  pull_request_target:
    types: [opened, synchronize, ready_for_review, reopened]

permissions:
  contents: read
  pull-requests: write

jobs:
  review:
    if: github.event.pull_request.draft == false
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
        with:
          ref: ${{ github.event.pull_request.base.sha }}
          persist-credentials: false
          fetch-depth: 1
      - uses: Lixiaoyiao/deepseek-harness-action@badb4542f53941ae99c13773574ea90e48a277a1 # v0.1.0
        with:
          deepseek-api-key: ${{ secrets.DEEPSEEK_API_KEY }}

现在打开一个非 draft PR。Action 会读取 diff 和仓库上下文,并发布 review summary;有确定问题时,也会在对应代码行留下评论。

完整模板见 examples/fork-review.yml。这个 workflow 使用 pull_request_target,只 checkout 受信任的 base SHA,不会运行 fork 里的代码。

能做什么

入口结果
PR opened / synchronize / ready_for_review自动 review,发布 summary 和行内评论
@dsh review手动重新 review 当前 PR
@dsh diagnose读取失败的 check 和日志,定位原因
@dsh fix在受信任写模式下修改代码并运行验证
Issue 中的 @dsh implement理解 Issue、改代码、运行验证并创建 PR

命令必须出现在评论第一行。可以直接复制这些 workflow:

fiximplement 不会因为写了命令就自动获得权限。你还需要在 workflow 中设置 allow-write: "true",并配置测试命令。详细输入见 action.yml

写模式

allow-write 默认是 false。写入只对同仓库、受信任操作者开放;fork PR 始终是 review-only。测试命令使用 argv 数组,不经过 shell 展开:

with:
  allow-write: "true"
  run-tests: "true"
  test-commands: '[["npm","ci","--ignore-scripts"],["npm","test"],["npm","run","typecheck"]]'
  container-image: docker.io/library/node:24.18.0-bookworm@sha256:5711a0d445a1af54af9589066c646df387d1831a608226f4cd694fc59e745059

写模式要求使用完整的 Docker image digest。Docker 需要在 runner 上可用。

安全

仓库文件、diff、CI 日志、Issue、PR 和评论都按不可信数据处理。

  • GITHUB_TOKEN 只留在 Action controller,不会交给 DSH。
  • DeepSeek key 由 controller 侧代理注入,不会进入工作区或测试命令。
  • fork 不获得文件系统或执行工具;pull_request_target 不 checkout PR head。
  • 写入前会重新检查操作者权限、仓库来源、绑定的 commit 和实际改动文件。
  • 验证在单独的无凭据容器中运行。

完整的信任边界、已知限制和漏洞报告方式见 SECURITY.md。v0.1.0 固定使用 @deepseek-ai/dsh@0.1.0-rc.6;DSH 仍在快速迭代,升级前请重新检查配置。

架构

GitHub event
    ↓
Action controller: route → authorize → snapshot
    ↓
DSH worker in Docker
    ↓
Action controller: validate → comment / commit / open PR

DSH worker 不持有 GitHub client。模型输出通过 schema 校验后,才由 controller 映射到 diff 行、更新 tracking 评论或执行受信任写入。

开发

需要 Node.js 24。

npm ci
npm run check

Marketplace 使用的 dist/ 会随 release 一起提交。依赖和打包说明见 BUNDLED_DEPENDENCIES.md

License

MIT。第三方许可见 THIRD_PARTY_NOTICES.md

Acknowledgements