DEV Community

Simon Hofmann
Simon Hofmann

Posted on • Originally published at blog.s1h.org

3 1

Debugging GitHub Actions

Have you ever spent 20+ commits to debug a CI setup? Yes?

EDIT: As pointed out by follow redditors, sshing into a GitHub actions runner might cause trouble with GitHubs TOS.

A better alternative to this approach is act, a handy CLI tool which allows us to run our Actions workflow locally. It uses Docker containers to replace build machines (only Linux is supported at the moment), so we're still able to debug our workflow without having to play the endless commit ping-pong.

Wanted to ssh into the build machine to check some things?

We were facing the same situation today and were happy to discover  mxschmitt/action-tmate@v2.

This action allows you to ssh into the runner executing your workflow to manually verify your build.

It will install and start tmate, which allows you to join the running terminal session, so it's possible to either connect va ssh or web terminal. Connection details will be printed in the command output.

mxschmitt/action-tmate@v2 allowed us to identify the root cause of our problem and we were able to fix our build quickly, a huge win in terms of debuggability!

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay