Queries the GitHub actions runner's public IP address using ipify
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.
This action allows you to whitelist the runner's address and remove it once the pipeline finishes.
maxRetries
- How many retries on the ipify API before failing. Default:5
ipv4
- Public IPv4 of the runneripv6
- Public IPv6 of the runner. If not available theipv4
will be returned
name: Public IP
on: push
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Public IP
id: ip
uses: haythem/public-ip@v1.2
- name: Print Public IP
run: |
echo ${{ steps.ip.outputs.ipv4 }}
echo ${{ steps.ip.outputs.ipv6 }}
We would love for you to contribute to haythem/public-ip
, pull requests are welcome !
The scripts and documentation in this project are released under the MIT License