一个轻量级的 PR 防护栏,用于依赖更新。
它仅扫描新增或变更的依赖项(来自您的锁定/清单文件),获取健康与风险信号(deps.dev + 启发式分析),标记新近发布的包,在 PR 上评论一份报告,可选地为安全审查添加标签,并且可以在策略命中时使任务失败。
支持的生态系统: PyPI(poetry.lock、requirements.txt、uv.lock)、npm/yarn(package-lock.json、yarn.lock)、Go(go.mod)。
security review 标签并以警告模式运行(CI 保持绿色以避免过多打扰)。默认非阻塞: 它不是硬性阻断,只是一个减速带,以便在检测到可疑内容时提醒您。您的 CI 管道不会失败,但依赖风险会在评论中呈现。您可以在 PR 上回复
accept-risk,以抑制对已标记软件包的未来通知,直到您再次提交清单变更。
适用于使用 Poetry / npm / Yarn / Go 仓库的最小工作流:
name: Heisenberg 健康检查
on:
pull_request:
paths:
- "**/poetry.lock"
- "**/uv.lock"
- "**/package-lock.json"
- "**/yarn.lock"
- "**/requirements.txt"
- "**/go.mod"
permissions:
contents: read
pull-requests: write # PR 评论
issues: write # 创建标签(仅在 add_security_label 为 true 时需要)
jobs:
deps-health:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: 检测变更的清单文件
id: detect
run: |
git fetch origin ${{ github.base_ref }} --depth=1
LOCK_PATH=$(git diff --name-only origin/${{ github.base_ref }} | \
grep -E 'poetry.lock$|uv.lock$|package-lock.json$|yarn.lock$|requirements.txt$|go.mod$' | head -n1 || true)
echo "lock_path=$LOCK_PATH" >> $GITHUB_OUTPUT
- name: Heisenberg 依赖健康检查
uses: AppOmni-Labs/heisenberg-ssc-gha@v1
with:
package_file: ${{ steps.detect.outputs.lock_path }}
如果您不希望该动作为带有标记依赖项的 PR 添加 Security Review 标签,请将 add_security_label 设置为 "false":
- name: Heisenberg 依赖健康检查
uses: AppOmni-Labs/heisenberg-ssc-gha@v1
with:
package_file: ${{ steps.detect.outputs.lock_path }}
add_security_label: "false"