mirror of
https://github.com/babalae/genshin-redeem-code.git
synced 2026-01-25 21:52:14 +08:00
31 lines
847 B
YAML
31 lines
847 B
YAML
name: Sync to Mirror Repositories
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
workflow_dispatch: # 允许手动触发
|
|
|
|
jobs:
|
|
sync:
|
|
if: github.repository_owner == 'babalae'
|
|
runs-on: ubuntu-latest
|
|
environment:
|
|
name: product
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0 # 获取完整的git历史记录
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Set up Git
|
|
run: |
|
|
git config --global user.name "github-actions[bot]"
|
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
|
|
- name: Sync to CNB
|
|
run: |
|
|
git remote add cnb https://cnb.cool/bettergi/genshin-redeem-code.git || true
|
|
git push https://cnb:${{ secrets.CNB_TOKEN }}@cnb.cool/bettergi/genshin-redeem-code.git main
|
|
|