-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9e0f4f
commit 7504337
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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 |