Skip to content

Commit 578d389

Browse files
authored
[mypy_primer] use merge base as base commit (#11627)
Solves hauntsaninja/mypy_primer#21 Co-authored-by: hauntsaninja <>
1 parent ffb1bac commit 578d389

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

.github/workflows/mypy_primer.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,19 @@ jobs:
3737
cd mypy_to_test
3838
echo "new commit"
3939
git rev-list --format=%s --max-count=1 $GITHUB_SHA
40-
git checkout -b upstream_master origin/master
40+
41+
MERGE_BASE=$(git merge-base $GITHUB_SHA origin/master)
42+
git checkout -b base_commit $MERGE_BASE
4143
echo "base commit"
42-
git rev-list --format=%s --max-count=1 upstream_master
44+
git rev-list --format=%s --max-count=1 base_commit
45+
4346
echo ''
4447
cd ..
4548
# fail action if exit code isn't zero or one
4649
(
4750
mypy_primer \
4851
--repo mypy_to_test \
49-
--new $GITHUB_SHA --old upstream_master \
52+
--new $GITHUB_SHA --old base_commit \
5053
--num-shards 3 --shard-index ${{ matrix.shard-index }} \
5154
--debug \
5255
--output concise \

0 commit comments

Comments
 (0)