File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,10 +48,12 @@ jobs:
4848 id : changed-files
4949 run : |
5050 if [ "${{ github.event_name }}" == "pull_request" ]; then
51- # Fetch only the base commit we need
52- git fetch origin ${{ github.event.pull_request.base.sha }} --depth=1
53- BASE_COMMIT=${{ github.event.pull_request.base.sha }}
54- HEAD_COMMIT=${{ github.event.pull_request.head.sha }}
51+ git fetch origin ${{ github.event.pull_request.base.ref }}:refs/remotes/origin/${{ github.event.pull_request.base.ref }} --depth=50
52+ BASE_COMMIT=$(git merge-base HEAD origin/${{ github.event.pull_request.base.ref }})
53+ HEAD_COMMIT=HEAD
54+ echo "Base branch: ${{ github.event.pull_request.base.ref }}"
55+ echo "Base commit (merge-base): $BASE_COMMIT"
56+ echo "Head commit: $HEAD_COMMIT"
5557 CHANGED_FILES=$(git diff --name-only --diff-filter=ACMR $BASE_COMMIT..$HEAD_COMMIT | grep '\.sol$' || true)
5658 else
5759 CHANGED_FILES=$(git diff --name-only --diff-filter=ACMR HEAD^..HEAD | grep '\.sol$' || true)
You can’t perform that action at this time.
0 commit comments