Update Configuration #392
This file contains hidden or 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 Configuration | |
on: | |
schedule: | |
- cron: '0 */12 * * *' | |
workflow_dispatch: | |
jobs: | |
update-config: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Download Source files | |
run: | | |
wget -O accelerated-domains.china.conf https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/refs/heads/master/accelerated-domains.china.conf | |
wget -O apple.china.conf https://raw.githubusercontent.com/felixonmars/dnsmasq-china-list/refs/heads/master/apple.china.conf | |
- name: Convert Dnsmasq to AdGuard format | |
run: | | |
set -e | |
for file in $(find . -type f -name "*.conf"); do | |
python3 converter.py "$file" | |
done | |
- name: Merge Configuration | |
run: | | |
cat $(find . -type f -name "*_AdGuard.conf") > configuration.txt | |
[ -f trusted_upstream.txt ] && cat trusted_upstream.txt >> configuration.txt | |
- name: Commit & Push Changes | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add configuration.txt | |
git diff --cached --quiet || (git commit -m "Update configuration" && git push) |