Skip to content

update_version_api #503

update_version_api

update_version_api #503

name: update_version_api
on:
workflow_dispatch:
release:
jobs:
update_version_api:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
show-progress: false
- name: Update Version API
run: |
python ./MaaAssistantArknights/update_version.py
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Git config
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Add files to git
id: commit
run: |
git add .
status=$(git status --porcelain)
if [ -z "$status" ]; then
echo "Nothing to commit, working tree clean."
echo "working_tree_clean=true" >> $GITHUB_OUTPUT
exit 0
else
echo "Found changes:"
git status
fi
commit_msg="chore: Update Version API"
git commit -m "$commit_msg"
- name: Push files to github
if: steps.commit.outputs.working_tree_clean != 'true'
run: |
git push
- name: Deploy
if: steps.commit.outputs.working_tree_clean != 'true'
run: |
gh workflow run deploy
env:
GH_TOKEN: ${{ secrets.MISTEOWORKFLOW }}