Pull IPRanges Daily #163
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: Pull IPRanges Daily | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
workflow_dispatch: | |
jobs: | |
pull_ipranges: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout this repository | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }} | |
- name: Create microsoft folder | |
run: mkdir -p microsoft | |
- name: Create amazon folder | |
run: mkdir -p amazon | |
- name: Create google folder | |
run: mkdir -p google | |
- name: Pull Microsoft IP Ranges | |
run: | | |
git clone --depth 1 --filter=blob:none --sparse https://github.com/lord-alfred/ipranges.git temp-ipranges | |
cd temp-ipranges | |
git sparse-checkout set microsoft | |
cp -r microsoft/* ../microsoft/ | |
cd .. | |
rm -rf temp-ipranges | |
- name: Pull Amazon IP Ranges | |
run: | | |
git clone --depth 1 --filter=blob:none --sparse https://github.com/lord-alfred/ipranges.git temp-ipranges | |
cd temp-ipranges | |
git sparse-checkout set amazon | |
cp -r amazon/* ../amazon/ | |
cd .. | |
rm -rf temp-ipranges | |
- name: Pull Google IP Ranges | |
run: | | |
git clone --depth 1 --filter=blob:none --sparse https://github.com/lord-alfred/ipranges.git temp-ipranges | |
cd temp-ipranges | |
git sparse-checkout set google | |
cp -r google/* ../google/ | |
cd .. | |
rm -rf temp-ipranges | |
- name: Commit changes | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
git add microsoft amazon google | |
git commit -m "Daily update of IP Ranges" | |
git push origin HEAD:main | |
env: | |
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} |