The tests workflow can pause and hand you a terminal on the GitHub Actions runner, using upterm. Access is limited to whoever started the workflow, and authentication uses the SSH keys registered on that GitHub account.
-
You need an SSH-key registered with GitHub. You either pick the key you have already used with
github.comor you create a dedicated new one withssh-keygen -t ed25519 -a 64 -f upterm_ed25519 -C "$(date +'%d-%m-%Y')"and add it athttps://github.com/settings/keys. -
If you created a dedicated key, add the following snippet to
~/.ssh/config:Host uptermd.upterm.dev PreferredAuthentications publickey IdentitiesOnly yes IdentityFile ~/.ssh/upterm_ed25519 -
Go to
https://github.com/<user>/<repo>/actions/workflows/tests.yml. -
Click the
Run workflowbutton and you will have the option to select the branch to run the workflow from and start a debugging session by checking theEnable remote debugging sessioncheckbox for this run. -
After the
workflow_dispatchevent was triggered, click theAll workflowslink in the sidebar and then click thetestsaction in progress workflow. -
Pick one of the jobs in progress in the sidebar.
-
Wait until the current task list reaches the
Setup upterm sessionstep and the output shows something like:➤ SSH: ssh 0963Vq8EQx1ExEKHdlK2@uptermd.upterm.dev ➤ SFTP: sftp 0963Vq8EQx1ExEKHdlK2@uptermd.upterm.dev ➤ SCP: scp <local> 0963Vq8EQx1ExEKHdlK2@uptermd.upterm.dev:<remote> scp 0963Vq8EQx1ExEKHdlK2@uptermd.upterm.dev:<remote> <local> -
Copy and execute the
sshline in the terminal, which attaches you to atmuxsession on the runner. Use thesftporscplines instead to copy files off the runner or onto it. -
Start the Bats test with
bats ./tests/test.bats. -
The session stays open until you
exitit or the workflow is cancelled.
For a more detailed documentation see action-upterm and upterm.
