xxiaoxiong/dsh-ci
dsh-ci
已收录
1
Workflow
Bundle 已验证
功能介绍
面向 DeepSeek Harness 的通用 CI/CD 能力,支持 GitHub Actions、有限失败证据提取、源码定位诊断,以及带审批控制的重跑与取消操作。
适合
- 需要依据有限且可定位到源码的证据诊断 GitHub Actions 失败的开发者。
- 需要查询工作流、Job、Step 和产物状态且不想解析原始 CLI 输出的 Agent。
- 需要日志敏感信息脱敏,并对重跑或取消操作设置审批门禁的团队。
不适合
- 当前版本尚未实现的 GitLab CI、Jenkins、CircleCI 或其他 CI 提供商。
- 必须读取完整无限制日志的调查;返回证据会限制大小并聚焦错误。
- 必须在未启用写操作或未经用户审批时自动重跑、取消流水线的场景。
- 无法映射到 GitHub,或没有可用 GitHub 凭据访问的仓库。
README
dsh-ci - Continuous Integration (CI) plugin for DeepSeek Harness (DSH)
dsh-ci is a generic, provider-neutral CI/CD plugin for DeepSeek Harness (DSH). It enables agents to inspect CI runs, extract bounded failure evidence, locate source errors, and safely rerun or cancel pipelines.
The current version supports GitHub Actions as the primary CI provider. Its architecture is explicitly designed to be provider-neutral, allowing future implementations for GitLab CI, Jenkins, CircleCI, etc. without modifying the generic CI tool layer.
Architecture
DSH Agent
↓
Generic CI Tools (ci_status, ci_failure, etc.)
↓
ctx.ci (CIService Context interface)
↓
GitHubActionsProvider (implements CIService)
↓
GitHub Actions REST API
Key Features
- Generic CI Tools: A stable set of 9 tools exposed to the agent loop.
-
Ecosystem-neutral Service Layer: Abstract
CIServiceandAbstractCIProvidercore contracts. - Automatic Workspace Detection: Parses local git repository (origins, remotes, branches, HEAD) to automatically map owner and repository without user input.
- Failure evidence extraction: Bounded logs (default 8KB), error-focused extraction (only lines around errors), and de-duplication.
-
Failure Parser Registry: Specialized regex parser patterns to map compile errors, test suite failures, docker fails, and generic exit codes to exact source files, lines, and functions. Supports:
- TypeScript compilation errors (
tsc) - Jest / Vitest test runner failures
- pytest (Python) failures
- Maven / Gradle (Java) build failures
- Go test failures
- Cargo (Rust) compile errors
- ESLint errors
- Docker build errors
- npm install/dependency errors
- Generic command exit codes
- TypeScript compilation errors (
- Secret Redaction: Automatic scrubbing of sensitive tokens, private keys, passwords, and AWS keys from all log output returned to the LLM.
-
Write Approval Gates: Write operations (
ci_rerun,ci_cancel) are approval-gated and disabled by default (writeEnabled: false). Cancel operation always requires approval.
Installation
Add this plugin directly via DeepSeek Harness CLI:
dsh plugin add dsh-ci
Configuration
Add the following block to your settings.json or settings.local.json configuration file:
{
"plugins": {
"dsh-ci": {
"writeEnabled": false,
"maxLogSize": 8192,
"maxEvidenceItems": 50,
"apiBase": "https://api.github.com"
}
}
}
Credentials
The plugin integrates with the standard DSH credential manager. It will automatically check for credentials in the following order:
-
GH_TOKENenvironment variable -
GITHUB_TOKENenvironment variable - Local
ghauth credentials (via GitHub CLI helper)
Tool Reference
The plugin registers 9 provider-neutral tools inside DSH:
ci_status
Gets the overall CI status of the repository, current branch, or commit.
-
Parameters:
repository?,branch?,commit?
ci_runs
Lists recent workflow runs in the repository.
-
Parameters:
repository?,branch?,status?,limit?
ci_run
Retrieves a detailed description of a single run.
-
Parameters:
runId(required),repository?
ci_jobs
Lists all jobs and their execution steps inside a workflow run.
-
Parameters:
runId(required),repository?
ci_failure
Looks up a failed run, identifies the failing jobs/steps, parses their logs, and compiles a structured failure evidence block containing exact file paths, line numbers, test names, and a bounded log excerpt.
-
Parameters:
runId(required),jobId?,repository?,maxExcerpts?
ci_log
Fetches log excerpts for a given job or step. Excerpts are bounded in size and redact all secrets automatically.
-
Parameters:
jobId(required),stepId?,repository?,maxBytes?
ci_artifacts
Lists metadata about build artifacts.
-
Parameters:
runId(required),repository?
ci_rerun
Triggers a rerun of a workflow run. Requires write authorization.
-
Parameters:
runId(required),dryRun?,repository?
ci_cancel
Cancels an in-progress workflow run. Always requires approval.
-
Parameters:
runId(required),repository?
Security Model
- Untrusted Input: All log outputs are treated as untrusted data. We filter and redact strings matching high-risk signatures (e.g., token prefixes, private keys) to prevent prompt injection and credential leaking.
- Context Preservation: Full logs are never returned to the model. We slice logs to focus on errors, avoiding context window explosion.
- Approval Flow: Triggering runs or cancels will prompt the user with DSH Approval seam for explicit consent before issuing the REST requests.
License
MIT License.
常见问题常见问题
在启用了 DSH 的终端中执行已验证命令 dsh plugin --profile default add github:xxiaoxiong/dsh-ci。命令会解析公开 package 元数据,并保持插件与本页展示的目录身份一致。
兼容性以页面上展示的 bundle 与 profile 状态为准。如果某个 profile 尚未检测到,请先保持禁用,并在生产启用前阅读仓库文档。
GitHub 链接和 activity 元数据是 release 与维护状态的来源。新版本发布后重新查看本页,确认目录已经观察到最新版本。