Files
MaaAssistantArknights/.github/workflows/sync-resource.yml
2026-03-14 02:29:11 +08:00

53 lines
1.2 KiB
YAML

name: Resource Sync
on:
push:
branches:
- dev-v2
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@v6
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@v6
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