deepseek-harness-action
开发工具 活跃维护

deepseek-harness-action

Lixiaoyiao/deepseek-harness-action

可直接集成到CI流程的GitHub Action,支持AI自动代码审查、CI故障诊断、代码自动修复,还能将提交的Issue自动转为修复PR,开箱即用实现智能代码管理。

14
Stars 标星
1
Forks 分支
14
Watchers 关注
1
Open Issues
TypeScript
主要语言
MIT
开源协议
7.1 MB
仓库大小
3 个月前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:Lixiaoyiao/deepseek-harness-action
git clone https://github.com/Lixiaoyiao/deepseek-harness-action.git
git clone git@github.com:Lixiaoyiao/deepseek-harness-action.git
README.md main

DeepSeek Harness for GitHub

CI
Release
MIT

中文

Run DeepSeek Harness directly from GitHub pull requests, issues, failed CI jobs, and maintainer-authored automations.

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

The Action starts a credential-isolated DSH worker, validates its structured result, and lets a trusted Controller publish comments or validated changes. This is a community project, not an official DeepSeek or GitHub product. It is maintained by @Lixiaoyiao.

Core capabilities

Capability What it does
Pull request review Reviews new commits, publishes one summary, and adds high-confidence inline findings
General tasks Answers repository questions or performs an explicitly authorized coding task
CI diagnosis and repair Reads failed checks and logs; trusted workflows may validate and publish a fix
Issue implementation Turns an authorized Issue request into a validated branch and pull request
Controlled tools Offers strict, standard, and exact custom profiles for Bash, Web Search, Subagent, fixed commands, MCP, Bundle, and Plugin tools
Structured results Reports stable scalar outputs plus a schema-v1 result-json envelope on success and failure

v0.5.3 is a small architecture/security hardening patch. It stabilizes error identity, tightens Git checkout versus Controller-materialized tree handling, and clarifies validation security boundaries without adding Agent or product features. The exact audited DeepSeek Harness pin remains 0.1.1-rc.2.

Live runs

These public runs show the comments and Actions logs produced by this repository.

Scenario Run
PR review, including a rerun without duplicate comments PR #3 · Actions run
Diagnosis based on failed checks and logs Actions run
Fix and validation in trusted write mode Actions run
Issue implementation followed by a pull request Issue #4 → PR #5

Quick Start

Run the installer from the root of the repository you want to configure:

npm create deepseek-harness-action@latest

Choose one of these modes:

  • PR Review creates .github/workflows/dsh-review.yml.
  • @dsh Coding Commands creates .github/workflows/dsh-commands.yml.
  • Both creates both workflow files.

For CI or another non-interactive environment, pass the mode explicitly so the installer never waits for stdin:

npm create deepseek-harness-action@latest -- --mode both

The installer creates .github/workflows/ when needed and refuses to overwrite an existing target workflow. It does not add secrets, commit or push changes, or open a pull request. The generated workflows pin the Action to the immutable v0.5.2 release commit.

After installation, add DEEPSEEK_API_KEY under Settings → Secrets and variables → Actions. Open or update a non-draft pull request to trigger Review. For Coding Commands, put an @dsh command on the first line of an Issue or pull request comment. See Setup for the complete onboarding and security guide.

Manual installation

Add DEEPSEEK_API_KEY under Settings → Secrets and variables → Actions, then create .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@v0.5.3
        with:
          deepseek-api-key: ${{ secrets.DEEPSEEK_API_KEY }}
          dsh-version: 0.1.1-rc.2

Open a non-draft pull request. The Action checks out only the trusted base SHA, reads the pull request through GitHub APIs, and never executes fork code.

For production, replace v0.5.3 with the full immutable release commit SHA. See Setup for permissions, pinning, checkout rules, and complete templates.

Common @dsh commands

Put the command on the first line of an Issue or pull request comment.

Command Purpose
@dsh task --read <question> Explain code, inspect the repository, or answer a general question
@dsh task --write <task> Request a coding task; every write gate must still pass
@dsh review Review the current pull request again
@dsh diagnose Diagnose failed checks and logs
@dsh fix Repair a same-repository pull request in trusted write mode
@dsh implement Implement an Issue and open a pull request

--write, fix, and implement request capabilities; they do not grant them. The workflow must explicitly enable write mode and provide Controller-run validation. See Usage for commands and automation, and Configuration for the gates.

Security

  • The Agent receives neither the real GITHUB_TOKEN nor the real DeepSeek key. Only the Controller can call GitHub mutation APIs.
  • Repository content, diffs, issues, pull requests, comments, logs, model output, and tool output remain untrusted data.
  • Fork review uses a .git-less, credential-free worker and must check out only the trusted base SHA with persist-credentials: false.
  • Writes require a trusted same-repository context, authorized actors, Docker, allow-write: "true", non-empty fixed validation commands, and successful validation. Protected-path and Validation Integrity checks still apply.
  • Validation Integrity provides high-confidence weakening detection plus baseline replay for its supported entrypoints, scripts, test/config weakening, lock/toolchain controls, and known wrappers/interpreters; it is not complete cross-language dependency provenance or a formal proof.
  • Validation may use Docker bridge networking. On self-hosted or corporate-network runners, repository validation code may reach runner-accessible network services; use dedicated runners and runner-level segmentation/egress controls.
  • An approved Bundle, Plugin, or stdio MCP server is trusted worker code. ToolRuntime limits model-routed calls; it does not sandbox extension startup, background work, or direct process I/O.

Read the complete Security policy before enabling write mode, host execution, network access, or third-party extensions.

Documentation

Guide Contents
Setup · 中文 Installer, manual setup, Secret, permissions, safe checkout, and templates
Usage · 中文 @dsh commands, tasks, review, diagnose, fix, implement, and automation
Configuration Inputs, permission profiles, tools, validation, extensions, and outputs
Troubleshooting Denials, Docker, timeouts, cancellation, validation, and extension failures
Security policy Trust model, credential boundaries, network behavior, and known limitations
Extension contracts Deep technical contracts for MCP, Profile, Bundle, Plugin, ToolRuntime, and receipts
Maintainer release guide Local checks, Core E2E, release canary, version updates, and publishing
Contributing · Changelog Development workflow and release history

Development

Node.js 24 is required.

npm ci
npm run check

See CONTRIBUTING.md. The Marketplace dist/ bundle is committed for releases and must not be edited by hand.

License

MIT. Third-party licenses are listed in THIRD_PARTY_NOTICES.md and BUNDLED_DEPENDENCIES.md.

DeepSeek Harness supplies the headless runtime and official extension mechanisms. The GitHub integration also draws on the MIT-licensed Claude Code Action patterns and the execution/publication separation described by Codex GitHub Action; exact attributions are recorded in the third-party notices.