Skip to content

Instantly share code, notes, and snippets.

@rfc2822
Created September 29, 2025 11:12
Show Gist options
  • Save rfc2822/35e2a5f1644a6a5d4c103f274fb98e01 to your computer and use it in GitHub Desktop.
Save rfc2822/35e2a5f1644a6a5d4c103f274fb98e01 to your computer and use it in GitHub Desktop.
Fetch Github IPs
#!/bin/bash
# OUTPUT_FILE="/etc/hosts.github"
OUTPUT_FILE="hosts.github"
GITHUB_META_API="https://api.github.com/meta"
SCRIPT=`realpath $0`
echo "# GitHub Actions Runner IP Ranges [$GITHUB_META_API]" > $OUTPUT_FILE
echo "# Fetched by $SCRIPT on $(date)" >> $OUTPUT_FILE
echo -e >> $OUTPUT_FILE
curl -s "$GITHUB_META_API" | jq -r '.actions[]' >> $OUTPUT_FILE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment