GitHub Actions debugging tip: You can connect to the running build with ssh and get a shell within the GitHub Actions runner VM.
The recommended approach is to run the build in a PR in your own fork and make only temporary changes to enable the ssh shell. GitHub Actions runs within your own fork when you open a PR to your own fork. Before opening the PR, it's useful to sync your fork's master branch with origin/master. Please check instructions for "Personal GitHub Actions CI" in the dev mailing list archives.
Here's an example of SSH debugging I have: lhotari/pulsar-helm-chart#1 . I removed all other GitHub Actions workflows and added this action step to the workflow where I wanted to connect with ssh:
- name: Setup upterm session uses: lhotari/action-upterm@v1 with: limit-access-to-actor: true
You can remove
limit-access-to-actor: true to allow anyone to connect. The authentication is made by your ssh public key registered in GitHub.
After the build starts running, the action will print out the connection address. Here's an example:
Adding actor "lhotari" to allowed users. Fetching SSH keys registered with GitHub profiles: lhotari Fetched 2 ssh public keys Creating a new session. Connecting to upterm server ssh://uptermd.upterm.dev:22 Created new session successfully Entering main loop === CSHTNSXPCJ3IRT3NM6UX Command: tmux new -s upterm -x 132 -y 43 Force Command: tmux attach -t upterm Host: ssh://uptermd.upterm.dev:22 SSH Session: ssh cShTnSXPcj3iRT3nM6ux:MTAuMjQ0LjAuNzY6MjIemail@example.com
the ssh connection can be made by running
ssh cShTnSXPcj3iRT3nM6ux:MTAuMjQ0LjAuNzY6MjIfirstname.lastname@example.org (copy-paste from the log) .
After connecting, You can get the build to continue with sudo touch /continue command.
The shell will terminate when the build completes. If you want to keep it running, add another step in the GitHub Actions workflow to wait:
- name: Wait 1 hour run: sleep 3600
There are more details about action at https://github.com/marketplace/actions/debugging-with-ssh .