Skip to content

Queries GitHub actions runner's public IP address

License

Notifications You must be signed in to change notification settings

etchteam/public-ip

 
 

Repository files navigation

Public IP

Queries the GitHub actions runner's public IP address using ipify

Motivation

GitHub actions shared runners are hosted in Azure (Windows & Linux) and Mac Stadium for macOS, so whitelisting all these infrastructures can be difficult and needs to be updated every once in a while.

GitHub Help

This action allows you to whitelist the runner's address and remove it once the pipeline finishes.

Usage

Inputs

  • maxRetries - How many retries on the ipify API before failing. Default: 5

Outputs

  • ipv4 - Public IPv4 of the runner
  • ipv6 - Public IPv6 of the runner. If not available the ipv4 will be returned

Example workflow

name: Public IP

on: push

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
    - name: Public IP
      id: ip
      uses: haythem/[email protected]

    - name: Print Public IP
      run: |
        echo ${{ steps.ip.outputs.ipv4 }}
        echo ${{ steps.ip.outputs.ipv6 }}

Contributing

We would love for you to contribute to haythem/public-ip, pull requests are welcome !

License

The scripts and documentation in this project are released under the MIT License

About

Queries GitHub actions runner's public IP address

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 90.9%
  • JavaScript 9.1%