File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Sync with GitLab
2+
3+ on :
4+ schedule :
5+ - cron : ' 0 0 * * *'
6+ workflow_dispatch :
7+
8+ jobs :
9+ sync :
10+ runs-on : ubuntu-latest
11+ steps :
12+ - name : Checkout self
13+ uses : actions/checkout@v4
14+ with :
15+ fetch-depth : 0
16+ token : ${{ secrets.WF_TOKEN }}
17+
18+ - name : Backup workflow
19+ run : cp .github/workflows/sync.yml /tmp/sync.yml.bak
20+
21+
22+ - name : Force mirror update
23+ run : |
24+ git remote add upstream https://gitlab.com/Binaryify/neteasecloudmusicapi.git
25+ git fetch upstream
26+ git reset --hard upstream/main
27+ git clean -fd -x
28+
29+ - name : Restore workflow
30+ run : |
31+ mkdir -p .github/workflows
32+ cp /tmp/sync.yml.bak .github/workflows/sync.yml
33+
34+ - name : Commit and push
35+ run : |
36+ git config --global user.name "ILoveScratch Syncer: Sync and add workflow"
37+ git config --global user.email "sync@ilovescratch.com"
38+ git add .github/workflows
39+ if git diff-index --quiet HEAD --; then
40+ echo "No changes to commit"
41+ else
42+ git commit -m "ADD SYNC: Restore workflow $(date +'%Y-%m-%d')"
43+ git push --force origin main
44+ fi
You can’t perform that action at this time.
0 commit comments