-
Notifications
You must be signed in to change notification settings - Fork 4
35 lines (29 loc) · 1 KB
/
update_json.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
name: Update JSON from BoardCaster
on:
schedule:
- cron: '*/15 * * * *' # 每15分钟运行一次
workflow_dispatch: # 手动触发
jobs:
update-readme:
runs-on: ubuntu-latest
steps:
- name: Checkout Listener repository
uses: actions/checkout@v2
- name: Clone BoardCaster repository
run: git clone https://github.com/CS-BAOYAN/BoardCaster.git
- name: Copy and rename data.json to public/config/schools.json
run: |
cp BoardCaster/data.json public/config/schools.json
- name: Commit and push changes if there are any
run: |
git config --global user.name 'github-actions'
git config --global user.email '[email protected]'
git add public/config/schools.json
if git diff-index --quiet HEAD; then
echo "No changes to commit"
else
git commit -m "Update public/config/schools.json from BoardCaster"
git push
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}