From 6fef042f0b3157fb46426ef3c1e71e53b444ce21 Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Fri, 26 Apr 2024 13:54:13 -0700 Subject: [PATCH] use merge base for diff-tree --- .github/workflows/test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 57867950..e6993820 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -21,7 +21,9 @@ jobs: - id: changes run: | 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:]]))" }