Skip to content

Fetch google ip ranges #830

Fetch google ip ranges

Fetch google ip ranges #830

Workflow file for this run

name: Fetch google ip ranges
on:
schedule:
- cron: "0 4 * * *"
workflow_dispatch:
jobs:
main:
runs-on: ubuntu-latest
name: Fetch google ip ranges
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal token
fetch-depth: 0
- name: Get google's ip ranges
run: |
curl -sL https://www.gstatic.com/ipranges/goog.json | jq ".prefixes | .[] | .ipv4Prefix | select( . != null )" -r > ./ip/google-v4.txt
curl -sL https://www.gstatic.com/ipranges/goog.json | jq ".prefixes | .[] | .ipv6Prefix | select( . != null )" -r > ./ip/google-v6.txt
- name: Commit files
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add .
git commit -m "`date`" || true
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}