Skip to content

Daily Update Clash Config #2

Daily Update Clash Config

Daily Update Clash Config #2

Workflow file for this run

name: Daily Update Clash Config
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12'
- name: Install Dependencies
run: |
pip install requests pyyaml urllib3
- name: Run the script
run: |
python clash.py
python clash_extra.py
- name: Commit and Push changes
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
CURRENT_TIME=$(TZ='Asia/Shanghai' date '+%Y-%m-%d %H:%M:%S (UTC+8)')
git diff-index --quiet HEAD || git commit -m "${CURRENT_TIME}"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}