-
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 tmate_ed25519 -C "$(date +'%d-%m-%Y')"and add it athttps://github.com/settings/keys. -
Add the following snippet to
~/.ssh/config:
Host *.tmate.io
User git
AddKeysToAgent yes
UseKeychain yes
PreferredAuthentications publickey
IdentitiesOnly yes
IdentityFile ~/.ssh/tmate_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 activatetmateby checking theDebug with tmatecheckbox 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
tmate debugging sessionsection and the output shows something like:
106 SSH: ssh PRbaS7SLVxbXImhjUqydQBgDL@nyc1.tmate.io
107 or: ssh -i <path-to-private-SSH-key> PRbaS7SLVxbXImhjUqydQBgDL@nyc1.tmate.io
108 SSH: ssh PRbaS7SLVxbXImhjUqydQBgDL@nyc1.tmate.io
109 or: ssh -i <path-to-private-SSH-key> PRbaS7SLVxbXImhjUqydQBgDL@nyc1.tmate.io
-
Copy and execute the first option
ssh PRbaS7SLVxbXImhjUqydQBgDL@nyc1.tmate.ioin the terminal and continue by pressing either q or Ctrl + c. -
Start the Bats test with
bats ./tests/test.bats.
For a more detailed documentation about tmate see Debug your GitHub Actions by using tmate.
