You want to debug a runner either because it failed or for the heck of it;
You go to the Actions tab and find the list of actions in the left colum and select Mac or Windows (but not Linux - see Notes below):
You then go to the far right and click the Run workflow dropdown:
Note, the Branch: dropdown - currently (because this PR hasn't landed) I can only do it for this branch. After this PR lands you'll be able to do it for any branch;
You check either one of the options; hopefully the descriptions are sufficient - if not ask in this PR and I'll update the descriptions accordingly;
The runner will run to completion or failure and then, at the end, start spamming
Note, not indefinitely but 600 spams;
Copy-paste and you'll arrive at a tmux session that looks like this:
Hit ctrl-c and you'll be dropped into tmux:
The job (not the whole action) exits/ends when you quit the session.
A few things to call out:
You need an ssh key that's associated with your GH username (e.g., the one you're using to commit/push); Note you don't need to do the -i part, ssh will find it automatically if it's under ~/.ssh;
This isn't enabled for the Linux runner. Why? I only added this to the free GitHub runners, not any nod runners, because this is clearly an attack vector. So don't add it to any of our runners (at least not until/unless I do this);
Yes, this works on Windows too but you land in git-bash/mingw/msys. If you want powershell (or cmd) then you can do powershell (or cmd);
If you don't know how to use tmux just refer to this cheatsheet.
This PR adds the ability to SSH into runners using https://github.com/mxschmitt/action-tmate. The way it works is like this:
You want to debug a runner either because it failed or for the heck of it;
You go to the
Actions
tab and find the list of actions in the left colum and select Mac or Windows (but not Linux - see Notes below):You then go to the far right and click the
Run workflow
dropdown:Note, the
Branch:
dropdown - currently (because this PR hasn't landed) I can only do it for this branch. After this PR lands you'll be able to do it for any branch;You check either one of the options; hopefully the descriptions are sufficient - if not ask in this PR and I'll update the descriptions accordingly;
The runner will run to completion or failure and then, at the end, start spamming
Note, not indefinitely but 600 spams;
Copy-paste and you'll arrive at a tmux session that looks like this:
Hit
ctrl-c
and you'll be dropped intotmux
:The job (not the whole action) exits/ends when you quit the session.
A few things to call out:
-i
part,ssh
will find it automatically if it's under~/.ssh
;git-bash
/mingw
/msys
. If you want powershell (or cmd) then you can dopowershell
(orcmd
);tmux
just refer to this cheatsheet.