File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 7979 if [ "${{ github.event_name }}" = "pull_request" ]; then
8080 base_sha="${{ github.event.pull_request.base.sha }}"
8181 head_sha="${{ github.event.pull_request.head.sha }}"
82+ # Match GitHub's PR diff: exclude commits added to the base branch
83+ # after the PR branch diverged.
84+ diff_range="$base_sha...$head_sha"
8285 else
8386 base_sha="${{ github.event.before }}"
8487 head_sha="${{ github.sha }}"
88+ diff_range="$base_sha..$head_sha"
8589 fi
8690
8791 full=false
9094 # Fall back to a full run when there is no usable diff base (new
9195 # branch, or a force push whose previous head no longer exists).
9296 if [ -z "$base_sha" ] || [[ "$base_sha" =~ ^0+$ ]] \
93- || ! git diff --name-only "$base_sha" "$head_sha " > changed-files.txt 2>/dev/null; then
97+ || ! git diff --name-only "$diff_range " > changed-files.txt 2>/dev/null; then
9498 full=true
9599 else
96100 # Map each changed path to the GPU test group(s) it affects.
You can’t perform that action at this time.
0 commit comments