Răsfoiți Sursa

【修复,CI】upgrade 拉取完整历史修复 merge 失败

Merge pull request #13 from xidongbot/fix/auto-upgrade-pr
PJ568 2 luni în urmă
părinte
comite
22badf07eb
1 a modificat fișierele cu 8 adăugiri și 0 ștergeri
  1. 8 0
      .github/workflows/upstream-check.yml

+ 8 - 0
.github/workflows/upstream-check.yml

@@ -115,7 +115,15 @@ jobs:
       issues: write
       pull-requests: write
     steps:
+      # fetch-depth: 0(完整历史):prepare 需合并远端 PR 分支,浅克隆(默认 depth=1)缺少共同祖先,
+      # merge 会报 "refusing to merge unrelated histories"
+      #
+      # fetch-depth: 0 (full history): prepare merges the remote PR branch and needs the common
+      # ancestor; a shallow clone (default depth=1) fails the merge with
+      # "refusing to merge unrelated histories"
       - uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
 
       # 在版本提升前准备 PR 分支:分支不存在则从 master 新建;存在则合并 master 最新内容,
       # 保证后续 push 为 fast-forward(ruleset 禁 force push;若先 bump 再切分支,bump 结果会被覆盖)