samsesh / github-ip-address-list

Automatically generate MikroTik address-list from GitHub's public IPs using GitHub Actions – ready to import in .rsc format.

Repository from Github https://github.comsamsesh/github-ip-address-listRepository from Github https://github.comsamsesh/github-ip-address-list

GitHub IP List for MikroTik

This repository automatically fetches the latest list of GitHub IP addresses from https://api.github.com/meta, and converts them into a MikroTik-compatible .rsc script file.

The script updates daily using GitHub Actions and is ideal for firewall rules, NAT exceptions, or routing GitHub traffic via specific interfaces.


📆 File Generated

  • github-ip-list.rsc A MikroTik-compatible RouterOS script that adds all GitHub IP ranges into an address list named GitHub.

Example content:

# Auto‎-generated MikroTik address list – GitHub IPs
/ip firewall address-list
add address=140.82.112.0/20 list=GitHub
add address=185.199.108.0/22 list=GitHub
add address=192.30.252.0/22 list=GitHub
...

🚀 MikroTik Import Script

To automatically fetch and import the IP list into your MikroTik router, run the following script:

:foreach i in={"GitHub"} do={
  /tool fetch url="https://raw.githubusercontent.com/samsesh/github-ip-address-list/Localhost/github-ip-list.rsc" dst-path=$i
  /ip firewall address-list remove [/ip firewall address-list find list=$i]
  /import file-name=$i
  /file remove $i
}

✅ This script will:

  • Download the latest IP list from your GitHub repo
  • Remove old entries in the GitHub address list
  • Import the updated list
  • Clean up the downloaded file

🔁 Automation

This repo uses a GitHub Actions workflow that:

  • Runs daily at midnight UTC
  • Fetches the latest GitHub IP ranges from the GitHub Meta API
  • Builds and commits a MikroTik .rsc file (github-ip-list.rsc) to the Localhost branch

You can also run the workflow manually from the Actions tab.


📘 References


☕ Support This Project

If you find this useful, you can support development here: 👉 https://donate.samsesh.net


🧑‍💻 Maintainer

Author: samsesh Website: samsesh.net

About

Automatically generate MikroTik address-list from GitHub's public IPs using GitHub Actions – ready to import in .rsc format.

License:GNU General Public License v3.0


Languages

Language:RouterOS Script 100.0%