Update IP list #538
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 list | |
on: | |
push: | |
paths: | |
- secure-as.txt | |
workflow_dispatch: | |
schedule: | |
# Run daily at 3am | |
- cron: '0 3 * * *' | |
jobs: | |
update-ip-list: | |
name: Update IP list | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Build IP list | |
run: python3 build-ip-list.py | |
- name: Commit result | |
run: | | |
set -e | |
git config user.name "github-actions[bot]" | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
# Commit only if there has been changes | |
if [[ -n $(git status --porcelain ipv4-whitelist.txt ipv6-whitelist.txt) ]]; then | |
git add ipv4-whitelist.txt ipv6-whitelist.txt | |
git commit -m "Autoupdate IP lists" | |
git push | |
else | |
echo "No changes made" | |
fi |