Skip to content

Commit 23447ca

Browse files
authored
Add a section how to debug Github Actions with tmate to the README.md (#29)
1 parent 73ad449 commit 23447ca

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

README.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [What is ddev-addon-template?](#what-is-ddev-addon-template)
66
* [Components of the repository](#components-of-the-repository)
77
* [Getting started](#getting-started)
8+
* [How to debug in Github Actions](#how-to-debug-in-github-actions)
89

910
## What is ddev-addon-template?
1011

@@ -46,6 +47,45 @@ A repository like this one is the way to get started. You can create a new repo
4647

4748
Note that more advanced techniques are discussed in [DDEV docs](https://ddev.readthedocs.io/en/latest/users/extend/additional-services/#additional-service-configurations-and-add-ons-for-ddev).
4849

50+
## How to debug in Github Actions
51+
1. You need a SSH-key registered with Github. You either pick the key you already authenticate with `github.com` or you create a dedicated new one with `ssh-keygen -t ed25519 -a 64 -f tmate_ed25519 -C "$(date +'%d-%m-%Y')"` and add it at `https://github.com/settings/keys`.
52+
53+
2. Add the following snippet to `~/.ssh/config`
54+
55+
```
56+
Host *.tmate.io
57+
User git
58+
AddKeysToAgent yes
59+
UseKeychain yes
60+
PreferredAuthentications publickey
61+
IdentitiesOnly yes
62+
IdentityFile ~/.ssh/tmate_ed25519
63+
```
64+
3. Go to `https://github.com/<user>/<repo>/actions/workflows/tests.yml`.
65+
66+
4. Click the `Run workflow`- button and you will have the option to the select the branch to run the workflow from and activate `tmate` by checking the `Debug with tmate` checkbox for this run.
67+
68+
![tmate](images/gh-tmate.jpg)
69+
70+
5. After the `workflow_dispatch`-event was triggered click the `All workflows`-link in the sidebar and then click the in progress workflow `tests`.
71+
72+
7. Pick one of the jobs in progress in the sidebar.
73+
74+
8. Wait until the current task list reaches the `tmate debugging session` section and the output shows something like:
75+
76+
```
77+
106 SSH: ssh [email protected]
78+
107 or: ssh -i <path-to-private-SSH-key> [email protected]
79+
108 SSH: ssh [email protected]
80+
109 or: ssh -i <path-to-private-SSH-key> [email protected]
81+
```
82+
83+
9. Copy and execute the first option `ssh [email protected]` in the terminal and continue by pressing either `q` or `ctrl-c`.
84+
85+
10. Start the bats test with `bats tests/test.bats`.
86+
87+
For a more detailed documentation about `tmate` see [Debug your GitHubActions by using tmate](https://mxschmitt.github.io/action-tmate/)
88+
4989
**Contributed and maintained by [@CONTRIBUTOR](https://github.com/CONTRIBUTOR) based on the original [ddev-contrib recipe](https://github.com/ddev/ddev-contrib/tree/master/docker-compose-services/RECIPE) by [@CONTRIBUTOR](https://github.com/CONTRIBUTOR)**
5090

5191
**Originally Contributed by [somebody](https://github.com/somebody) in <https://github.com/ddev/ddev-contrib/>

images/gh-tmate.jpg

53.9 KB
Loading

0 commit comments

Comments
 (0)