How To Debug GitHub Actions With SSH

One feature that CircleCI has that I like is the ability to debug failed job runs via ssh.

It’s the one feature I thought GitHub Actions didn’t have until I found the debugging with ssh action.

This action replicates that feature from CircleCI. You can set it up so that you can ssh into your failed jobs like this:

    - name: Setup upterm session
      uses: lhotari/action-upterm@v1
      if: ${{ failure() }}
        ## limits ssh access and adds the ssh public key for the user which triggered the workflow
        limit-access-to-actor: true
        ## If no one connects after 5 minutes, shut down server.
        wait-timeout-minutes: 3

The one drawback is it’s not built into the platform like CircleCI’s feature. You should be explicit and set up this action when you need to debug inside a GitHub Actions runner.

If you set it up to always run when there’s a failure, even with a timeout, you could be spending a lot of extra money letting your runners sit around.

Like what you've read?

If you're an engineering leader or developer, you should subscribe to my 80/20 DevOps Newsletter. Give me 1 minute of your day, and I'll teach you essential DevOps skills. I cover topics like Kubernetes, AWS, Infrastructure as Code, and more.

Not sure yet? Check out the archive.

Unsubscribe at any time.