diff --git a/.coveragerc b/.coveragerc
index bbf9046b0649609ca5dc96ff29974addd96f00cf..11f2ec83879d4e82d08ed174dedc3219e2993e34 100644
--- a/.coveragerc
+++ b/.coveragerc
@@ -1,8 +1,8 @@
 [run]
 branch = True
 parallel = True
-include=$GITHUB_WORKSPACE/synapse/*
-data_file = $GITHUB_WORKSPACE/.coverage
+include=$TOP/synapse/*
+data_file = $TOP/.coverage
 
 [report]
 precision = 2
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index df2e3901cb70bbe355d6ff6c33bb53ad3a1bbc8c..de022020ccc5615e817e191f03f860cef262833f 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -200,6 +200,7 @@ jobs:
         WORKERS: ${{ matrix.workers && 1 }}
         REDIS: ${{ matrix.redis && 1 }}
         BLACKLIST: ${{ matrix.workers && 'synapse-blacklist-with-workers' }}
+        TOP: ${{ github.workspace }}
 
     strategy:
       fail-fast: false