Merge Script #780
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,3,13 * * *' # 每6h一次 | |
workflow_dispatch: # 触发手动事件 | |
jobs: | |
merge: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- 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: Commit Changes Firstly | |
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 | |
- name: Run sb script | |
run: python sb.py | |
- name: Commit Changes Secondly | |
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 |