Skip to content

update

update #17

Workflow file for this run

name: Update
on:
push:
branches:
- action
schedule:
- cron: "*/5 * * * *"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: main
path: main
- uses: actions/checkout@v4
with:
ref: action
path: action
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Run
run: |
cd main
pip3 install requests
python3 ../action/conver.py
- name: Check for modified files
id: git-check
run: |
cd main
if [ -n "$(git status --porcelain)" ];then echo "modified=true" >> $GITHUB_OUTPUT;fi
- name: Update
if: steps.git-check.outputs.modified == 'true'
run: |
cd main
echo "{\"alias_version\":\"`date +"%Y%m%d"`\",\"alias_url\":\"https://raw.githubusercontent.com/Becods/maimaiDX-CN-songs-alias-database/main/alias.json\"}" > update.json
git config user.name github-actions
git config user.email [email protected]
git add .
git commit -am "`date +"%Y-%m-%d"`"
git push