Skip to content

[release/0.4][Execute Infrastructure] Add bot approval required check gated on risemeup1111 approval#1462

Open
risemeup1111 wants to merge 1 commit into
PaddlePaddle:release/0.4from
risemeup1111:cherry-pick/1460/release/0.4
Open

[release/0.4][Execute Infrastructure] Add bot approval required check gated on risemeup1111 approval#1462
risemeup1111 wants to merge 1 commit into
PaddlePaddle:release/0.4from
risemeup1111:cherry-pick/1460/release/0.4

Conversation

@risemeup1111

Copy link
Copy Markdown
Contributor

PR Category

Execute Infrastructure

PR Types

Devs

Description

新增 .github/workflows/bot-approval-required.yml,在 pull_requestpull_request_review 事件上作为合入门禁的 required status check。

门禁通过条件(满足任一即可,且仅统计当前 head commit 上的评审):

  1. AI review 机器人 risemeup1111 对当前 head commit 提交了 APPROVED 评审;
  2. sneaxiyFrom00 任意一个账号对当前 head commit 提交了 APPROVED 评审。

未通过时的中文提醒: 提示 RD 按 AI review 机器人的意见修改代码并提交新 commit,或联系 sneaxiy / From00 approve;并附 P0/P1(必须修复并提交新 commit)、P2/P3(需针对评论回复)处理要求。

可靠性处理:

  • 按 review 的 commit_id 过滤到 github.event.pull_request.head.sha,避免旧 commit 上的审批在 push 新提交后仍放行未复审的新代码。
  • 使用 gh api --paginate ... | jq -s 'add' 分页读取全部 reviews,避免超过 100 条时漏判。
  • 仅需 contents: readpull-requests: read 权限。

Cherry-pick of #1460 to release/0.4.

Merged in dev: #1460

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants