Update Mihomo Config #113
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 Mihomo Config | |
on: | |
push: | |
paths: | |
- 'Mihomo/Extension_Script/**' | |
- .github/workflows/update_mihomo_config.yml | |
schedule: | |
- cron: '0 13 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
update_mihomo_config: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install requests pyyaml | |
- name: Run auto_update.py | |
run: | | |
cd Mihomo/auto_update_config | |
python auto_update_js.py | |
python auto_update_yaml.py | |
- name: Commit and push changes | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git add . | |
if git diff-index --quiet HEAD; then | |
echo "No changes to commit" | |
else | |
git commit -m "❓ chore: Update Mihomo Extension Script and Config" | |
git push | |
fi |