Why the IP keeps changing
Every job on a standard GitHub-hosted runner gets a new VM. GitHub publishes the address ranges in its meta API, but they are huge, shared by every GitHub customer and change over time. Allowlisting all of them is the same as allowlisting nobody.
Option 1: larger runners with a static IP range
On GitHub Team and Enterprise Cloud plans you can create larger runners and assign them static IP addresses. It is the most native option if you already pay for those plans and per-minute larger-runner pricing works for you.
Option 2: a self-hosted runner
Run the GitHub Actions runner on your own server with a fixed IP. You get full control, but you also patch, scale and secure that machine, and a compromised workflow runs on your infrastructure.
Option 3: keep hosted runners, send traffic through a dedicated IP
Keep the free hosted runners and route only the requests that need allowlisting through a server with a static IPv4. Two ways to do that:
- HTTP/SOCKS5 proxy: the simplest. Most tools honour the HTTPS_PROXY variable.
- WireGuard tunnel: routes everything (or chosen subnets) from the runner, useful for SSH, databases and non-HTTP traffic.
Proxy in a workflow
Store the proxy URL as a repository secret named MAZE_PROXY_URL, then set it only on the steps that need it:
- name: Deploy to allowlisted server
env:
HTTPS_PROXY: ${{ secrets.MAZE_PROXY_URL }}
HTTP_PROXY: ${{ secrets.MAZE_PROXY_URL }}
NO_PROXY: localhost,127.0.0.1
run: |
curl -s https://ifconfig.me # prints your static IP
./deploy.shWireGuard in a workflow
Save a WireGuard config (one config per repository or environment) as the secret WG_CONFIG:
- name: Connect WireGuard
run: |
sudo apt-get update -qq && sudo apt-get install -y -qq wireguard resolvconf
echo "${{ secrets.WG_CONFIG }}" | sudo tee /etc/wireguard/wg0.conf > /dev/null
sudo chmod 600 /etc/wireguard/wg0.conf
sudo wg-quick up wg0
curl -s https://ifconfig.me # prints your static IP
- name: Run migrations against the allowlisted database
run: ./migrate.shSecurity tips
- Use one proxy password or WireGuard config per repository, so you can revoke one without touching the others.
- Never echo the secret; GitHub masks it, but avoid set -x in steps that use it.
- Allowlist the single /32 address, not a range.
Skip the setup
A dedicated server and static IPv4 in 38 cities, ready in about 3 minutes. WireGuard for people, SOCKS5/HTTP proxy for code. From $9.99/month.