githubvirtual-machineip-addressgithub-actions-runners

Does every Virtual Machine that Github spins up for a workflow run get a new IP address?


The way Github Actions work is that they spin up a VM for every workflow run. Therefore, every run takes place on a different VM. Virtual Machines generally get a different IP whenever they are spun up. I can however find no official documentation which clarifies if this is the case with Github Actions runner VMs.


Solution

  • Update 2022:

    As noted in Krzysztof Madej's answer, GitHub now (Sept. 2022) proposes:

    GitHub Actions Larger runners – Are now in public beta

    That includes (for Team and Enterprise GitHub Action users only):

    Fixed IP ranges to provide access to runners via allow list services.

    So that would not apply for github.com runners.


    2021:
    This thread mentions (in 2019, so that might have changed since then):

    Windows and Ubuntu hosted runners are hosted in Azure and have the same IP address ranges as Azure Data centers.
    Currently, all hosted runners are in the East US 2 Azure region, but more regions may added over time.

    Microsoft updates the Azure IP address ranges weekly in a JSON file that you can download from the Azure IP Ranges and Service Tags - Public Cloud 153 website. You can use this range of IP addresses if you require an allow-list to prevent unauthorized access to your internal resources.

    So there should be a new address within a range of IPs.

    It references: "Specifications for GitHub-hosted runners", which mentions:

    Note: If you use an IP address allow list for your GitHub organization or enterprise account, you cannot use GitHub-hosted runners and must instead use self-hosted runners.
    For more information, see "About self-hosted runners."

    (Specifically, the IP address section)