File tree Expand file tree Collapse file tree 2 files changed +38
-23
lines changed Expand file tree Collapse file tree 2 files changed +38
-23
lines changed Original file line number Diff line number Diff line change
1
+ name : Sync Repo
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ workflow_dispatch :
8
+
9
+ jobs :
10
+ sync :
11
+ runs-on : ubuntu-latest
12
+ name : Sync Repository
13
+ steps :
14
+ - name : Checkout
15
+ uses : actions/checkout@v4
16
+ with :
17
+ fetch-depth : 0
18
+
19
+ - name : Setup SSH
20
+ run : |
21
+ mkdir -p ~/.ssh
22
+ echo "${{ secrets.GITEE_SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
23
+ chmod 600 ~/.ssh/id_rsa
24
+ ssh-keyscan gitee.com >> ~/.ssh/known_hosts
25
+
26
+ - name : Create single commit and push
27
+ run : |
28
+ git config user.name "GitHub Actions"
29
+ git config user.email "[email protected] "
30
+
31
+ # Create a new branch
32
+ git checkout --orphan new-main
33
+ git add .
34
+ git commit -m "Sync from GitHub: $(date)"
35
+
36
+ # Add Gitee remote and force push
37
+ git remote add gitee ${{ vars.GITEE_REPO_URL }}
38
+ git push --force gitee new-main:main
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments