diff --git a/.github/workflows/root-ci.yml b/.github/workflows/root-ci.yml
index fe4d2ff3b1079bad05ac89dcacf9d9be670d44d0..264554ed05ced37795240d835f9b1dd770ee4e87 100644
--- a/.github/workflows/root-ci.yml
+++ b/.github/workflows/root-ci.yml
@@ -358,6 +358,11 @@ jobs:
         with:
           name:  Test Results ${{ matrix.image }} ${{ matrix.config }}
           path: /tmp/workspace/build/TestResults.xml
+      - name: Setup tmate session
+        if: ${{ failure() }}
+        uses: mxschmitt/action-tmate@v3
+        # When debugging increase to a suitable value!
+        timeout-minutes: ${{ github.event.pull_request && 40 || 20 }}
 
   event_file:
     if: github.repository_owner == 'root-project' || github.event_name == 'pull_request'