Skip to content

ci: keep label events out of the required CI gate - #595

Merged
gansx merged 3 commits into
mainfrom
gansx/ci-label-required-check-fix
Oct 26, 2026
Merged

gansx merged 3 commits into
mainfrom
gansx/ci-label-required-check-fix

Conversation

@gansx

@gansx gansx commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

问题

Dependabot 开 PR 后 1 秒内自动打 2 个标签,每个 labeled 事件都会触发一次 CI run。这些标签 run 里聚合门禁 job 被改名为 CI label event (no validation),导致该 head 上最新的 CI run 不包含必需检查 Typecheck, unit tests, and Web build 的上下文,protect-main 规则评估报 "is expected",检查全绿的 PR 无法合并(今天 #588/#589/#591/#593/#594 全部被拦,#591 已用 recreate 绕过合并)。

修复

  • ci.yml 触发器移除 labeled,删除标签相关的条件分支(scope/quality 的 if、动态 job 名、IGNORED_LABEL_EVENT 早退、并发组特例)。
  • 新增 full-ci-label.yml:普通标签不产生任何 CI 运行;full-ci 标签对 PR head 分发一次完整 workflow_dispatch 运行(dispatch 事件本身即 complete 层级 + full 范围,与标签语义一致)。
  • full-ci 标签的持久效果保留:已打标签的 Draft 在后续 synchronize 等正常触发中仍按完整检查执行(classify/policy 继续读 PR 标签)。

这样任何 head 上最新的 CI 运行永远带有正确命名的门禁 job,规则评估恢复正常。

验证

  • node --test scripts/ci/*.test.mjs scripts/check-public-repo-safety.test.mjs 全部通过(含更新后的工作流结构断言)
  • check-markdown-links 通过;两个 workflow YAML 解析通过
  • docs/maintenance/ci.md 的触发事件说明已同步

Label-triggered CI runs renamed the aggregate gate to a label marker, so the
newest CI run on a Dependabot head lacked the required 'Typecheck, unit
tests, and Web build' context and the protect-main ruleset reported it as
expected, blocking merges on fully green PRs. Move label handling to a
dedicated full-ci-label workflow that dispatches a full validation run for
the full-ci label and produces no CI runs for unrelated labels.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T14:19:03.784490Z 395fed8 New commits
🔒 Security Review ✅ Completed 2026-10-26T14:22:48.293938Z 395fed8 New commits

Security findings

Advisory findings (1)

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d4f44d4231

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/full-ci-label.yml Outdated
Comment thread .github/workflows/full-ci-label.yml
…arget

Address two P1 review findings on full-ci-label.yml:
- workflow_dispatch --ref requires a branch or tag ref, not the head
  commit SHA; use the pull-request head branch ref instead.
- fork pull requests (including Dependabot) get a read-only GITHUB_TOKEN
  on pull_request events regardless of the permissions block; trigger via
  pull_request_target so the dispatch job keeps an actions:write token.
  The job stays a pure API caller: it never checks out or runs
  pull-request code, and it fails explicitly for forked head branches,
  which have no ref in this repository for workflow_dispatch to address.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛡️ Codex Security Review · Automatically triggered

Here are some automated security review suggestions for this pull request.

Reviewed commit: e02fa3abfe

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

Comment thread .github/workflows/full-ci-label.yml
@gansx
gansx merged commit d9a6402 into main Oct 26, 2026
15 checks passed
@gansx
gansx deleted the gansx/ci-label-required-check-fix branch October 26, 2026 14:47
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