Sync Fork and Run Script #88
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: Sync Fork and Run Script | |
on: | |
schedule: | |
- cron: '0 0 * * *' # 每天运行一次 | |
workflow_dispatch: | |
jobs: | |
sync-and-run-script: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
fetch-depth: 0 | |
ssh-key: ${{ secrets.SSH_KEY }} | |
- name: Configure git | |
run: | | |
git config --global user.email "[email protected]" | |
git config --global user.name "Heathcliff" | |
- name: Sync fork | |
run: | | |
git remote add upstream [email protected]:Steve-xmh/amll-ttml-db.git | |
git fetch upstream | |
git checkout main | |
git merge upstream/main | |
git push | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.x' | |
- name: Install dependencies (if any) | |
run: | | |
python -m pip install --upgrade pip | |
pip install glob2 | |
pip install lxml | |
- name: Run Python script | |
run: python ./scripts/convert2simplelrc.py | |
- name: Commit and push changes | |
run: | | |
git add . | |
git commit -m "Update lyrics" | |
git push |