From 7b1f1484ea4909d3a7f03b43d444be84542bd6c3 Mon Sep 17 00:00:00 2001 From: John Pennycook Date: Fri, 31 Jan 2025 16:48:03 +0000 Subject: [PATCH 1/2] Use base.sha instead of main in coverage.yml Signed-off-by: John Pennycook --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 896d0fc..ca6266c 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -39,7 +39,7 @@ jobs: - name: Generate coverage.json run: | - python -m coverage json --include=$(git diff --name-status main codebasin/*.py | grep "^M" | awk '{ print $2 }' | paste -sd,) + python -m coverage json --include=$(git diff --name-status ${{ github.event.pull_request.base.sha }} codebasin/*.py | grep "^M" | awk '{ print $2 }' | paste -sd,) - name: Check coverage against latest commits run: | From f43fd3283162e071d65adbeb9153b86d1efa063d Mon Sep 17 00:00:00 2001 From: John Pennycook Date: Fri, 31 Jan 2025 17:01:13 +0000 Subject: [PATCH 2/2] Use merge commit instead of HEAD in coverage.yml Signed-off-by: John Pennycook --- .github/workflows/coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index ca6266c..ec8b712 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -44,6 +44,6 @@ jobs: - name: Check coverage against latest commits run: | FROM=${{ github.event.pull_request.base.sha }} - TO=${{ github.event.pull_request.head.sha }} + TO=${{ github.sha }} COMMITS=$(git rev-list $FROM..$TO) python .github/workflows/check-coverage.py coverage.json --commits $COMMITS