Skip to content

UpdateRules.yml

UpdateRules.yml #1

Workflow file for this run

name: UpdateRules.yml
on:
schedule:
# 明天早上六点触发
- cron: '0 6 * * *'
# 手动触发事件
workflow_dispatch:
jobs:
update-rule:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get rule
run: |
wget https://adguardteam.github.io/AdGuardSDNSFilter/Filters/filter.txt -O Rules/filter.txt
wget https://anti-ad.net/easylist.txt -O Rules/easylist.txt
- name: Commit and push
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [ -z "$(git status --porcelain)" ]; then
exit 0
else
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "Update rule"
git push
fi