-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (39 loc) · 1.05 KB
/
update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Update
on:
schedule:
- cron: "15 6 * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
repository: Becods/gh-script
token: ${{ secrets.GH_PAT }}
path: script
- uses: actions/checkout@v4
with:
ref: main
path: data
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Run
run: |
pip3 install requests
python3 script/maimaiDX-songs.py
- name: Check for modified files
id: git-check
run: |
cd data
if [ -n "$(git status --porcelain)" ];then echo "modified=true" >> $GITHUB_OUTPUT;fi
- name: Update
if: steps.git-check.outputs.modified == 'true'
run: |
cd data
git config user.name github-actions
git config user.email github-actions[bot]@users.noreply.github.com
git add .
git commit -am "`date +"%Y-%m-%d"`"
git push