Debugging GitHub Actions with SSH

almirsarajcic

almirsarajcic

8 months ago

Sometimes seeing logs from GitHub Actions isn’t enough and you need to access the server.
Use csexton/debugger-action to SSH into the GitHub Actions runner.

- name: Setup Debug Session
  uses: csexton/debugger-action@master

While running the workflow, you’ll see something like this:

/Users/runner/work/_actions/csexton/debugger-action/master/script.sh
Setting up tmate...
Running tmate...
________________________________________________________________________________
To connect to this session copy-n-paste the following into a terminal:
ssh s3Dh2J4Hrw6ZDUKS8FTQJrvjU@sfo2.tmate.io
After connecting you can run touch /tmp/keepalive to disable the 15m timeout

Run the command it gives you and you’ll be in.

ssh s3Dh2J4Hrw6ZDUKS8FTQJrvjU@sfo2.tmate.io
The authenticity of host 'sfo2.tmate.io (157.230.72.130)' can't be established.
RSA key fingerprint is SHA256:Hthk2T/M/Ivqfk1YYUn5ijC2Att3+UPzD7Rn72P5VWs.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'sfo2.tmate.io' (RSA) to the list of known hosts.
The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
Mac-1731936867703:phx.tools runner$ 
Mac-1731936867703:phx.tools runner$