No-workflows repositories: three controls report unexpected_exit instead of saying there is nothing to audit

未关闭
#584 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

@JohnsonLyu 已经在做这个了。

开始于 2026年10月26日。

  • #685 来自 @JohnsonLyu —— 未关闭

评估

难度
3/5
预计耗时
半天
新手友好度
55/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
github-actions, python
领域
ci-cd, security

调研方向

Start with the exec handler that turns a non-zero exit into unexpected_exit, and with the three controls OSPS-BR-01.01, OSPS-BR-01.02 and OSPS-AC-04.02, which are gated on when = { ci_provider = "github" }. Check how zizmor exit code 3 and grep exit code 2 are handled when .github/workflows/ is missing. Done when a repository without workflows still gets WARN from these controls, but the message says there are no workflow files to audit, and the proposed option of pointing at confirming ci_provider is either implemented or ruled out.

由索引模型根据 Issue 内容生成。

描述

needs triage

Summary

Low priority, wording only, On a repository with no .github/workflows/ directory and no confirmed project context, three controls report WARN [unexpected_exit]:

WARNING: OSPS-BR-01.01: exec handler could not complete (error_class=unexpected_exit): Command exited with unexpected code 3: zizmor --format json --offline <repo>; stderr: ... fatal: no audit was performed ...
WARNING: OSPS-BR-01.02: exec handler could not complete (error_class=unexpected_exit): Command exited with unexpected code 2: grep -rln github.head_ref .github/workflows/; stderr: grep: .github/workflows/: No such file or directory
WARNING: OSPS-AC-04.02: exec handler could not complete (error_class=unexpected_exit): Command exited with unexpected code 3: zizmor --format json --offline <repo>; ...
  OSPS-BR-01.01: WARN [unexpected_exit] - Could not automatically verify - manual verification required

All three have when = { ci_provider = "github" }, the context has no ci_provider until a person confirms it, and running the control and reporting WARN is the cautious result.

The point is the reason shown. "Unexpected exit code 3" reads as a broken tool. What happened is well defined: zizmor exits 3 when it finds no inputs, and grep exits 2 when the directory is missing. A new user auditing a repository before adding CI sees three warnings that look like failures of darnit.

Possible direction

  • Recognize "no workflow files" for these steps and say so in the message, keeping WARN.
  • Or point the message at the ci_provider question: confirming it makes these controls not applicable.

Seen with zizmor 1.30.1 on main at 24a4fed.

Drafted with Claude; reviewed and filed by me.

主要语言
Python
星标
22
派生
27
平均合并
4 天 19 小时
30 天内合并 PR
72

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

darnitdevorg/darnit 的其他 Issue

查看 darnitdevorg/darnit 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。