Skip to content

[Bug] 自动格式化工作流只读取第一页,PR 变更超过 30 个文件时会漏掉待格式化文件 #12106

Backlog

Description

@wdfk-prog

RT-Thread Version

RT-Thread Version:master @ fbdb9711;复现 PR #12090,分支提交 8809d3c

Affected area

CI / GitHub Actions

Hardware/BSP vendor

Not applicable / Other

Architecture

Not applicable / Other

Board and hardware details

不涉及开发板或外设

Develop Toolchain

Other

Describe the bug

复现步骤

对一个变更超过 30 个文件的 PR,在 fork 上手动运行 Code Format with Clang-Format。以 #12090(head: 8809d3c)为例,该 PR 有 46 个变更文件。

实际结果

自动格式化日志显示只取到了 30 个文件。第一页里没有 components/drivers/can/utest/can_framework_tc.c,所以此文件根本没有被格式化。工作流最后显示「代码无需格式化」,并跳过提交和推送。与此同时,上游格式检查仍在该文件第 102–112 行报错。

上游的 pr_clang_format.yml也只请求了一次 PR 文件列表,没有读取后续页面。该接口默认每页返回 30 项。

预期结果

获取 PR 的全部文件页,再按现有规则筛选并格式化 C/C++ 文件。如果分页请求失败,应明确报错,不应在文件列表不完整时报告「代码无需格式化」。

Other additional context

建议按 GitHub REST API 的分页信息读取所有页面,不只把每页上限调大。验证时可以找一个变更超过 30 个文件、且待格式化的 C 文件在第二页的 PR,确认该文件被纳入格式化列表。

参考:List pull requests files

Activity

  1. added
    bug
    on Dec 1, 2026
  2. github-actions commented on Dec 1, 2026

    @github-actions

    如需认领并处理此 Issue,请评论 /claim。

    To claim and work on this issue, comment /claim.

  3. added
    action
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    actionbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions