Skip to content

ci: 增加 actionlint 工作流校验 - #286

Merged
Terry-Mao merged 5 commits into
mainfrom
chore/add-actionlint-285
Oct 2, 2026
Merged

Terry-Mao merged 5 commits into
mainfrom
chore/add-actionlint-285

Conversation

@Terry-Mao

Copy link
Copy Markdown
Owner

摘要

  • 在 CI 中安装并校验 actionlint,自动检查 .github/workflows/ 下的 YAML 工作流。
  • 为项目测试安装固定版本的 PyYAML,并补充 actionlint 与依赖安装步骤的测试覆盖。
  • 统一 Codex API、GitHub App 配置名称,移除旧的 OPENAI/APP_CLIENT_ID 回退说明并同步文档。

验证

  • PYTHONDONTWRITEBYTECODE=1 .venv/bin/python -m unittest discover -s .github/tests
  • PYTHONDONTWRITEBYTECODE=1 .venv/bin/python -m unittest discover -s .github/aicodingflow-tests
  • git diff --check

Refs #285

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

本 PR 为 CI 增加 actionlint 工作流校验、统一 CODEX/APP 配置名称并移除旧的 OPENAI_API_KEY/OPENAI_API_ENDPOINT 回退,整体方向清晰,actionlint 安装步骤也做了 sha256 校验。但 review-pr.yml 把 allow-bot-users: github-actions[bot] 改成了 allow-bots: github-actions[bot]:openai/codex-action@v1 的 allow-bots 是布尔输入(默认 false,见 action.yml/README),传入非布尔字符串会导致 action 内 check-write-access 的 parseBoolean 抛出 Invalid boolean value,使 Run AI review 这一步直接失败,整个 review 流程不可用。修复时需同时更新 .github/aicodingflow-tests/test_review_workflow_dispatch.py:152 中的断言。

Comment thread .github/workflows/review-pr.yml Outdated
@Terry-Mao

Copy link
Copy Markdown
Owner Author

@kratos-ci-bot /review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

审查范围:23 个文件,主要包含新增 actionlint CI 校验、CODEX_*/APP_ID 配置重命名及文档同步。已在 pr-worktree 中运行 .github/tests(13 项通过)以及相关 .github/aicodingflow-tests(test_codex_model_provider_config.py、test_review_workflow_dispatch.py 全部通过),并逐一核对 11 个 Codex workflow 与测试断言一致。

结论:未发现阻塞性问题,建议合并。历史讨论中已解决的 review-pr.yml 的 allow-bots 布尔输入问题,本 diff 已按建议改为 allow-bots: true,不再重复提出。

非阻塞项:

  • 文档措辞不一致:README.md:57 与 docs/github-collaboration-flow.md:25 将 CODEX_MODEL 描述为“必须配置”,但同文档表格(README.md:41、docs/github-collaboration-flow.md:17)写的是留空时回退 Codex 默认模型,workflow 也没有对 CODEX_MODEL 做非空校验。详见行内评论。
  • 配置迁移为破坏性变更:移除 OPENAI_API_KEY/OPENAI_API_ENDPOINT 回退并将 GitHub App variable 从 APP_CLIENT_ID 改为 APP_ID 后,已有目标仓库需手动迁移;建议在发布说明或升级指引中明确提示。

Comment thread README.md Outdated
@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Applied requested changes on chore/add-actionlint-285.

Summary:

摘要

  • 修正 README.md 与 docs/github-collaboration-flow.md 中“必须设置 CODEX_MODEL”的表述。
  • 改为 CODEX_API_KEY 和 CODEX_API_ENDPOINT 必须配置,CODEX_MODEL 可选、为空时使用 Codex 默认模型,与配置表格和 workflow 实现保持一致。

验证

#286

@Terry-Mao
Terry-Mao merged commit 6388ee4 into main Oct 2, 2026
@Terry-Mao
Terry-Mao deleted the chore/add-actionlint-285 branch October 2, 2026 06:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant