File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -20,7 +20,15 @@ source "${SCRIPT_DIR}/read-benchmark-config.sh"
2020if [[ " ${GITHUB_EVENT_NAME} " == " pull_request" ]]; then
2121 BASE_SHA=" ${GITHUB_BASE_REF} "
2222 git fetch origin " ${BASE_SHA} " --depth=1 2> /dev/null || true
23- CHANGED_FILES=$( git diff --name-only " origin/${BASE_SHA} ...HEAD" -- ' benchmarks/' )
23+ CHANGED_FILES=$( git diff --name-only " origin/${BASE_SHA} ...HEAD" -- ' benchmarks/' 2> /dev/null || true)
24+ if [[ -z " ${CHANGED_FILES} " ]]; then
25+ # The three-dot range needs a merge base, which a shallow (--depth=1)
26+ # fetch of the base lacks once master advances past the PR's branch
27+ # point — git then aborts with "no merge base". PR builds check out
28+ # refs/pull/N/merge, so HEAD~1 is the base tip; diffing against it
29+ # yields exactly the PR's changes without requiring a merge base.
30+ CHANGED_FILES=$( git diff --name-only HEAD~1 HEAD -- ' benchmarks/' 2> /dev/null || true)
31+ fi
2432else
2533 # Push event: compare against the last commit that was successfully published
2634 # to SciMLBenchmarksOutput. This makes change detection cumulative — if a
You can’t perform that action at this time.
0 commit comments