Merge Script #214
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: Merge Script | |
on: | |
# push: | |
# branches: | |
# - main # 替换为你的默认分支 | |
schedule: | |
- cron: '0 0/6 * * *' # 每 6h 一次 | |
workflow_dispatch: # 触发手动事件 | |
jobs: | |
merge: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
- name: Install dependencies | |
run: pip install -r requirements.txt | |
- name: Run merge script | |
run: python meta_merge.py | |
# - name: Run shadowrocket merge script | |
# run: python merge.py | |
# - name: Run sing-box script | |
# run: python sing-box.py | |
- name: Commit Changes | |
run: | | |
if [[ -n "$(git status --porcelain)" ]]; then | |
echo "Changes detected in the repository." | |
git config core.ignorecase false | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add . | |
git commit -m "Updated at $(date '+%Y-%m-%d %H:%M:%S')" | |
git push | |
else | |
echo "No changes detected in the repository." | |
fi |