You can use this GitHub action [1] to get SSH access to a GitHub runner. If you need access to the GUI you should be able to use ngrok, perhaps with this GitHub action [2]. I've tried tmate both with Linux and macOS runners. I've only tried ngrok with Linux runners.
CircleCI supports macOS runners and has native support for rerunning failed builds with SSH access. So just setup a job that always fails.