浏览代码

Merge pull request #3958 from ollama/mxyng/fix-workflow

use merge base for diff-tree
Michael Yang 1 年之前
父节点
当前提交
7fea1ecdf6
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      .github/workflows/test.yaml

+ 3 - 1
.github/workflows/test.yaml

@@ -31,7 +31,9 @@ jobs:
       - id: changes
       - id: changes
         run: |
         run: |
           changed() {
           changed() {
-            git diff-tree -r --no-commit-id --name-only ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }} \
+            git diff-tree -r --no-commit-id --name-only \
+              $(git merge-base ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}) \
+              ${{ github.event.pull_request.head.sha }} \
               | xargs python3 -c "import sys; print(any([x.startswith('$1') for x in sys.argv[1:]]))"
               | xargs python3 -c "import sys; print(any([x.startswith('$1') for x in sys.argv[1:]]))"
           }
           }