Update JSON from BoardCaster #14448
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: 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 'github-actions@github.com' | |
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 }} |