mirror of
https://github.com/MaaAssistantArknights/MaaAssistantArknights.git
synced 2026-07-15 17:30:27 +08:00
53 lines
1.2 KiB
YAML
53 lines
1.2 KiB
YAML
name: Resource Sync
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- dev
|
|
paths:
|
|
- ".github/workflows/sync-resource.yml"
|
|
- "resource/**"
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
sync-resource:
|
|
name: Sync Resource to MaaResource
|
|
if: github.repository_owner == 'MaaAssistantArknights'
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v5
|
|
with:
|
|
show-progress: false
|
|
|
|
- name: Configure git
|
|
run: |
|
|
git config --global user.name 'github-actions[bot]'
|
|
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
|
git show -s
|
|
|
|
- name: Checkout MaaResource
|
|
uses: actions/checkout@v5
|
|
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
|