Update IP CIDRs list #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update IP CIDRs list | |
on: | |
schedule: | |
- cron: 0 0 * * 0 | |
workflow_dispatch: | |
workflow_call: | |
permissions: | |
contents: write | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Get jq | |
run: | | |
sudo apt install jq -y | |
- name: Update IP CIDRs | |
run: | | |
echo "" > ${{ github.workspace }}/ip.txt | |
while read -r line; do | |
curl -sL "https://ip.guide/${line}" | jq ".routes.v4, .routes.v6 | join(\"\n\")" -r >> ${{ github.workspace }}/ip.txt | |
done <vpsh.txt | |
- name: Commit to repo | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add -A | |
git commit -am "IP CIDRs update [$(date -u -Iminutes)]" | |
git push |