Skip to content

Commit 1207ed9

Browse files
committed
Update worklow
1 parent 5d02913 commit 1207ed9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/python-test.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ jobs:
2929
node_version: ["20.14", "22"]
3030
steps:
3131
- uses: actions/checkout@v5
32+
with:
33+
# Fetch full history so diff-cover can compute a merge base with origin/main
34+
fetch-depth: 0
3235
- name: Install uv
3336
uses: astral-sh/setup-uv@v6
3437
with:
@@ -65,8 +68,10 @@ jobs:
6568
- name: Check diff coverage
6669
if: runner.os != 'Windows'
6770
run: |
68-
git fetch origin main:refs/remotes/origin/main
69-
diff-cover coverage.xml --compare-branch=origin/main --fail-under=90
71+
BASE_REF="${{ github.base_ref }}"
72+
if [ -z "$BASE_REF" ]; then BASE_REF="main"; fi
73+
git fetch origin "$BASE_REF:refs/remotes/origin/$BASE_REF"
74+
diff-cover coverage.xml --compare-branch="origin/$BASE_REF" --fail-under=90
7075
- name: Run E2E tests with Playwright
7176
id: e2e
7277
if: runner.os != 'Windows'

0 commit comments

Comments
 (0)