forked from MaaAssistantArknights/MaaAssistantArknights
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (47 loc) · 1.34 KB
/
sync-resource.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
56
name: sync-resource
on:
workflow_dispatch:
push:
branches:
- dev
paths:
- "resource/**"
- ".github/workflows/sync-resource.yml"
jobs:
sync-reource:
runs-on: ubuntu-latest
steps:
- name: Checkout MaaAssistantArknights
uses: actions/checkout@v4
with:
show-progress: false
- name: Setup Git
run: |
git config --global user.name "$GITHUB_ACTOR"
git config --global user.email "$GITHUB_ACTOR@users.noreply.github.com"
git show -s
- name: Checkout MaaResource
uses: actions/checkout@v4
with:
repository: MaaAssistantArknights/MaaResource
show-progress: false
ssh-key: ${{secrets.MAA_RESOURCE_DEPLOY}}
path: MaaResource
- name: Update MaaResource
run: |
export commit_msg=$(git show -s --format=%s)
cd MaaResource
shopt -s extglob
cd resource
rm -rf !(".gitignore")
cp -rf ../../resource/* .
cd ..
git add .
git status
git commit -m "$commit_msg" || exit 0
git push
- name: Setup resource update
env:
GH_TOKEN: ${{ secrets.MISTEOWORKFLOW }}
run: |
gh workflow --repo MaaAssistantArknights/MaaRelease run update-resource.yml