Skip to content

cbdq-io/github-action-get-public-ip

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Get Resilient Public IP

A lightweight, resilient GitHub Action that determines the public IPv4 address of the current GitHub Actions runner by attempting multiple fallback IP discovery services.

Ideal for use cases such as temporarily whitelisting the runner IP for secure provisioning (e.g., firewalls, cloud APIs, Kubernetes control planes, etc.).


📦 Features

  • ✅ Tries multiple IP lookup services until one succeeds
  • 🛡️ Reliable in case of individual service failures or throttling
  • 🔧 Accepts custom list of IP sources (optional)
  • 🧺 Includes a reusable CI test workflow

📦 Usage

🔺 Basic (Use Default Sources)

- uses: cbdq-io/[email protected]
  id: ip_step

- run: echo "Public IP is ${{ steps.ip_step.outputs.ip }}"

🔺 Custom Sources

Override the list of public IP services if you prefer to control or test specific endpoints:

- uses: cbdq-io/github-action-get-public-ip@v1
  id: ip_custom
  with:
    sources: https://api.ipify.org https://checkip.amazonaws.com

🔧 Inputs

Name Description
sources (optional) Space-separated list of URLs to use for public IP discovery. The action will try each in order until one returns a valid IPv4 address. Defaults to a predefined, reliable set.

Default value:

https://ipv4.icanhazip.com https://ifconfig.me https://api.ipify.org https://checkip.amazonaws.com https://ipinfo.io/ip

📤 Outputs

Name Description
ip The detected public IPv4 address of the GitHub Actions runner

✅ Example Output

✅ IP found: 203.0.113.42

You can use this value in your Terraform pipelines, cloud CLI configs, etc.


📄 License

BSD-3


💬 Feedback & Contributions

  • Issues and PRs welcome!
  • Ideas for IPv6 or DNS integration also appreciated.

About

A GitHub Action that retrieves the runner's public IPv4 address using multiple fallback sources for reliability.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •