Skip to content

Commit 8c60e5a

Browse files
authored
After a branch is deleted, force quick tests to run the full suite. (#551)
1 parent df6d3c1 commit 8c60e5a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.github/workflows/integration_tests.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,13 @@ jobs:
175175
else
176176
# If running in a PR, diff against the PR's base.
177177
# "git merge-base main branch_name" will give the common ancestor of both branches.
178-
MERGE_BASE=$(git merge-base origin/${{github.event.pull_request.head.ref}} origin/${{github.event.pull_request.base.ref}})
179-
echo "::warning ::Auto-diff origin/${{github.event.pull_request.head.ref}}..${MERGE_BASE}"
180-
git diff --name-only origin/${{github.event.pull_request.head.ref}}..${MERGE_BASE}
181-
echo "AUTO_DIFF_PARAM=--auto_diff origin/${{github.event.pull_request.head.ref}}..${MERGE_BASE}" >> $GITHUB_ENV
178+
MERGE_BASE=$(git merge-base origin/${{github.event.pull_request.head.ref}} origin/${{github.event.pull_request.base.ref}} || true)
179+
# If origin/<branch> is no longer valid, then just run all tests.
180+
if [[ -n "${MERGE_BASE}" ]]; then
181+
echo "::warning ::Auto-diff origin/${{github.event.pull_request.head.ref}}..${MERGE_BASE}"
182+
git diff --name-only origin/${{github.event.pull_request.head.ref}}..${MERGE_BASE}
183+
echo "AUTO_DIFF_PARAM=--auto_diff origin/${{github.event.pull_request.head.ref}}..${MERGE_BASE}" >> $GITHUB_ENV
184+
fi
182185
fi
183186
- id: export-result
184187
# e.g. 'ubuntu-latest,macos-latest' -> '["ubuntu-latest","macos-latest"]'

0 commit comments

Comments
 (0)