Debugging using Reverse RDP with ngrok
ActionsTags
(2)Ever wonder what the Desktop of the Windows Runners on GitHub Actions looks like?
This functionality is like Appveyor's RDP functionality for their Windows workers:
https://www.appveyor.com/docs/how-to/rdp-to-build-worker/
- Signup for an ngrok account & Get the tunnel auth token at: https://dashboard.ngrok.com/auth .
- Under the repository's settings, make a repository secret called
NGROK_AUTH_TOKEN
and set it to the tunnel auth token from ngrok. - Embed this action in your build workflow:
- name: Test background
uses: NyaMisty/reverse-rdp-windows-github-actions-ng@master
with:
ngrok-token: ${{ secrets.NGROK_AUTH_TOKEN }}
password: "Aa123456" # You can also put the password in secrets as you wish.
#foreground: false
- The foreground parameter can be used to run this action in background (i.e. non-blocking)
- You can also run this action multiple time with different
foreground
parameter acting as workflow breakpoint
- Visit ngrok's dashboard. https://dashboard.ngrok.com/ & Get address in ngrok's
Cloud Edge
->Endpoints
- Connect to the host and port combination with your RDP client of choice.
- Username is always
runneradmin
, with password you specified above (defaults toP@ssw0rd!
)
- Enjoy! ☕
- When you're done introspecting, delete the file
Delete-This-File-To-Continue.txt
on desktop to continue the action
These steps should be useful for debugging broken builds directly on the build worker. Use this project as reference and toss the steps into your project after some failing part of the build for introspection.
- Runners can run jobs for up to 6 hours. So you have about 6 hours minus the minute setup time to poke around in these runners.
- Use 'if' expression of action step to achieve precise control of enabling RDP
- Example1 - run RDP when failure:
if: failure()
- Example2 - run on manually dispatch:
- add input parameter under
on: workflow_dispatch:
:on: workflow_dispatch: inputs: debug_enabled: description: 'Run the build with ngrok debugging enabled' required: false default: false
if: ${{ always() && github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
- add input parameter under
- Example1 - run RDP when failure:
These projects also allow remote introspection of very temporary environments like in GitHub Actions or other environments.
- action-tmate (very mature, can spawn SSH on all runners)
- Shell-Only (macOS, Linux, and also Windows)
- macOS VNC
MIT
Debugging using Reverse RDP with ngrok is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.