-
Notifications
You must be signed in to change notification settings - Fork 27
55 lines (45 loc) · 1.31 KB
/
update_version_api.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
47
48
49
50
51
52
53
54
55
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 "[email protected]"
- 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 }}