Skip to content

feat: add github action for sync #1

feat: add github action for sync

feat: add github action for sync #1

Workflow file for this run

name: Sync to Organization Repository
# 监听 push 到 main 分支的事件
on:
push:
branches:
- main
jobs:
sync-repo:
runs-on: ubuntu-latest
steps:
# Step 1: Checkout 源仓库的代码
- name: Checkout Source Repository
uses: actions/checkout@v3
# Step 2: 配置 Git 用户信息
- name: Setup Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
# Step 3: 添加组织仓库作为远程仓库
- name: Add Organization Repository as Remote
run: |
git remote add target https://x-access-token:${{ secrets.SC_SYNC_TOKEN }}@github.com/RWAWrapper/SmartContract.git
git fetch target
# Step 4: 将代码推送到组织仓库的 main 分支
- name: Push Changes to Organization Repository
run: |
git push target main --force