File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 2525 steps :
2626 - name : Checkout Repository
2727 uses : actions/checkout@v4
28+ with :
29+ # Fetch enough history for diff against base branch
30+ fetch-depth : 0
2831
2932 - name : Cache cargo builds
3033 uses : Swatinem/rust-cache@v2
6871 if : github.event_name == 'pull_request'
6972 id : changed
7073 run : |
71- git fetch origin ${{ github.base_ref }} --depth=1
72- changed_files=$(git diff --name-only origin/${{ github.base_ref }}...HEAD -- '*.rs' | tr '\n' ' ')
74+ # Use GitHub's provided base/head SHAs for accurate diff
75+ base_sha="${{ github.event.pull_request.base.sha }}"
76+ head_sha="${{ github.event.pull_request.head.sha }}"
77+ changed_files=$(git diff --name-only "$base_sha" "$head_sha" -- '*.rs' | tr '\n' ' ')
7378 echo "files=$changed_files" >> "$GITHUB_OUTPUT"
7479
7580 - name : Generate coverage report data
You can’t perform that action at this time.
0 commit comments