mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-19 22:09:27 +02:00
update
This commit is contained in:
parent
30ab56f190
commit
8e892b2805
50
.github/workflows/optimize-assets.yml
vendored
50
.github/workflows/optimize-assets.yml
vendored
@ -8,43 +8,45 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Sync fork
|
|
||||||
uses: tgymnich/fork-sync@v1.8.0
|
|
||||||
with:
|
|
||||||
token: ${{ secrets.FORK_SYNC_TOKEN }}
|
|
||||||
owner: pagefaultgames
|
|
||||||
base: main
|
|
||||||
head: main
|
|
||||||
|
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
token: ${{ secrets.FORK_SYNC_TOKEN }}
|
||||||
|
|
||||||
- name: Merge main branch
|
- name: Sync with upstream
|
||||||
id: merge_main
|
id: sync
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: |
|
run: |
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
git config --local user.name "github-actions[bot]"
|
git config --local user.name "github-actions[bot]"
|
||||||
git fetch origin main
|
|
||||||
if git merge origin/main --no-edit; then
|
# 添加上游仓库
|
||||||
echo "merge_status=success" >> $GITHUB_OUTPUT
|
git remote add upstream https://github.com/pagefaultgames/pokerogue.git
|
||||||
|
|
||||||
|
# 获取上游更新
|
||||||
|
git fetch upstream main
|
||||||
|
|
||||||
|
# 检查是否有更新需要同步
|
||||||
|
if git rev-list HEAD..upstream/main --count | grep -q "^0$"; then
|
||||||
|
echo "sync_status=uptodate" >> $GITHUB_OUTPUT
|
||||||
|
echo "仓库已是最新,无需同步"
|
||||||
else
|
else
|
||||||
echo "merge_status=failed" >> $GITHUB_OUTPUT
|
# 合并上游更新
|
||||||
exit 1
|
if git merge upstream/main --no-edit; then
|
||||||
|
echo "sync_status=success" >> $GITHUB_OUTPUT
|
||||||
|
git push
|
||||||
|
else
|
||||||
|
echo "sync_status=failed" >> $GITHUB_OUTPUT
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Check merge status
|
- name: Check sync status
|
||||||
if: steps.merge_main.outputs.merge_status == 'failed'
|
if: steps.sync.outputs.sync_status == 'failed'
|
||||||
run: |
|
run: |
|
||||||
echo "合并 main 分支失败,请手动解决冲突"
|
echo "同步上游仓库失败,请手动解决冲突"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
||||||
- name: Push merged changes
|
|
||||||
if: steps.merge_main.outputs.merge_status == 'success'
|
|
||||||
run: |
|
|
||||||
git push
|
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
@ -106,7 +108,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Commit and push if changed
|
- name: Commit and push if changed
|
||||||
if: steps.check_changes.outputs.changes == 'true' && steps.merge_main.outputs.merge_status == 'success'
|
if: steps.check_changes.outputs.changes == 'true' && steps.sync.outputs.sync_status == 'success'
|
||||||
run: |
|
run: |
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
git config --local user.name "github-actions[bot]"
|
git config --local user.name "github-actions[bot]"
|
||||||
|
Loading…
Reference in New Issue
Block a user