Skip to content

Fix Clang-Format workflow failure caused by shallow checkout state - #274

Merged
star-e merged 2 commits into
v4.0.0from
copilot/fix-clang-format-failure
Aug 15, 2026
Merged

Fix Clang-Format workflow failure caused by shallow checkout state#274
star-e merged 2 commits into
v4.0.0from
copilot/fix-clang-format-failure

Conversation

Copilot AI commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

The Clang-Format Actions job failed while creating the formatting PR, not during formatting, due to a shallow-repo fetch transition (git fetch --unshallow) error. This change ensures the workflow starts from a full clone so downstream git operations are stable.

  • Workflow hardening

    • Updated .github/workflows/native-clang-format.yml checkout step to fetch full history (fetch-depth: 0) for the PR head SHA used by the formatting job.
    • Prevents the fatal: shallow file has changed since we read it failure path in later branch/reset logic.
  • Minimal diff

    • Single-line workflow change; no formatting logic, paths, or exclusions were modified.
- uses: actions/checkout@v4
  with:
    token: ${{ github.token }}
    ref: ${{ github.head_sha }}
    fetch-depth: 0

测试方法

不需要测试,用于github cocos robot提交clang format代码。

Co-authored-by: star-e <13654656+star-e@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix failing GitHub Actions job Clang-Format Fix Clang-Format workflow failure caused by shallow checkout state Aug 15, 2026
Copilot AI requested a review from star-e August 15, 2026 10:39
@star-e
star-e marked this pull request as ready for review August 15, 2026 11:50
@star-e
star-e merged commit 0eac18b into v4.0.0 Aug 15, 2026
16 checks passed
@star-e
star-e deleted the copilot/fix-clang-format-failure branch September 4, 2026 07:33
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.

2 participants