Debugging Github Actions
Recently I had the tricky task of getting Behat to run as a CI step in a github actions file. Behat can be tricky enough to get working on a host, but doing it as part of CI is even harder if you can’t dig into any problems.
The solution? Creating an upterm session so that we can SSH onto the docker instance. We simply add the following step to our github actions file:
– name: Setup upterm session
uses: lhotari/action-upterm@v1
If we then trigger the action via a commit and push, we can see the connection info against the job’s step:
If we copy the value against the “SSH Session:” field and paste that into a terminal (OSX, Linux only) we can SSH on to the Github actions docker container — e.g:
$ ssh mLKGffdkblkjGSDFMGSDFM3423BVBM=@uptermd.upterm.dev
NOTE: Using this technique with a public repository may allow anyone to SSH onto the docker instance whilst the action is running. I’m not sure it’s a huge issue though as that docker instance only exists to satisfy the current run of the action. Each time github actions runs, you will get a new docker instance and a new SSH key.
Source: https://brudinie.medium.com/feed
- Congratulation to Stuart for PHM – 25th April 2025
- Moodle jobs: Moodle Developer roles – Full-time – UK based remote – 20th April 2025
- Debugging docker exit 0 – 12th February 2025