update_hosts.py #240
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_hosts.py | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: 0 15 * * * | |
permissions: write-all | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install dependencies | |
run: pip install requests | |
- name: Run update_hosts.py | |
env: | |
VIRUSTOTAL_API_KEY: ${{ secrets.VIRUSTOTAL_API_KEY }} | |
run: python update_hosts.py | |
- name: Commit & Push | |
run: | | |
git config user.email [email protected] | |
git config user.name github-actions | |
git add . | |
git commit -m "更新 APP 去广告 hosts" | |
git pull --rebase | |
git push | |
continue-on-error: true |