This repository contains a GitHub Actions workflow that provides secure, on-demand Remote Desktop Protocol (RDP) access to a GitHub-hosted Windows runner.
Instead of exposing the RDP port to the public internet, this workflow uses Tailscale to create a secure, private overlay network. This allows you to connect directly to the runner from your local machine as if it were on the same local network, without complex firewall configurations or the security risks of a public IP.
- Secure by Default: RDP access is restricted to your private Tailscale network (Tailnet), never exposed to the public internet.
- On-Demand Access: Trigger the workflow manually whenever you need interactive access.
- Dynamic User Creation: Automatically creates a dedicated RDP user with credentials you provide via GitHub Secrets.
- Robust Configuration: The workflow includes checks for credentials, sets up firewall rules, and verifies connectivity.
- Long-Running Sessions: The job is configured with a long timeout and a final step that keeps the runner alive so you can stay connected.
Before you can use this workflow, you need the following:
- A GitHub Repository where you will add this workflow file.
- A Tailscale Account. You can sign up for a free personal account at tailscale.com.
- The Tailscale Client installed and running on your local machine (the one you'll be connecting from).
Follow these steps to configure the workflow in your repository.
Step 1: Fork This Repository by clicking here
An auth key allows the GitHub runner to join your private Tailnet without needing to log in interactively.
- Go to your Tailscale Admin Console: https://login.tailscale.com/admin/settings/keys
- Click Generate auth key....
- Click Generate key and check on the reusable toggle.
- Copy the key immediately. You will not be able to see it again. It will look like
tskey-auth-k....
You must store sensitive information like passwords and auth keys as encrypted secrets in your repository.
-
In your GitHub repository, go to Settings > Secrets and variables > Actions.
-
Click New repository secret for each of the following secrets:
TAILSCALE_AUTH_KEY: Paste the Tailscale auth key you generated in the previous step.RDP_USERNAME: Choose a username for the RDP account (e.g.,admin,dev,runner).RDP_PASSWORD: Create a strong password for the RDP account. Windows runners have password complexity requirements, so use a password with at least 8 characters, including uppercase letters, lowercase letters, and numbers.
Because this workflow is triggered by workflow_dispatch, you must start it manually.
- Go to the Actions tab in your GitHub repository.
- In the left sidebar, click on the RDP workflow.
- You will see a message: "This workflow has a
workflow_dispatchevent trigger." Click the Run workflow button. - Keep the default branch selected and click the green Run workflow button again.
-
Click on the newly started workflow run. You will see the
secure-rdpjob running. -
Click on the
secure-rdpjob to view the live logs. -
Wait for the job to run through the setup steps. The final step, Maintain Connection, will print the necessary credentials.
-
Look for the following output in the logs:
=== RDP ACCESS === Address: 100.XX.XX.XX ==================- Address: This is the Tailscale IP address of the GitHub runner.
- Username: The username you set in the
RDP_USERNAMEsecret. - Password: The password you set in the
RDP_PASSWORDsecret (it will be masked as***in the logs for security, but the workflow uses the real value).
- Ensure the Tailscale client is running and you are logged in on your local machine.
- Open your preferred RDP client (e.g., "Remote Desktop Connection" on Windows or "Microsoft Remote Desktop" on macOS).
- In the "Computer" or "PC name" field, enter the Tailscale IP Address from the logs.
- When prompted, enter the Username and Password you configured in the GitHub secrets.
- Connect! You should now have a full desktop session on the GitHub Actions runner.
The runner will stay online for up to 6 hours (the timeout-minutes value). When you are finished with your session:
- Go back to the GitHub Actions workflow run page and click Cancel workflow. This is important as it stops the runner and prevents you from using up your free Actions minutes.