Skip to content

Commit c7d6e0b

Browse files
authored
Update GiteeMirror.yml
1 parent 98e8869 commit c7d6e0b

File tree

1 file changed

+35
-16
lines changed

1 file changed

+35
-16
lines changed

.github/workflows/GiteeMirror.yml

Lines changed: 35 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,38 @@
1-
name: GiteeMirror
1+
# 通过 Github actions, 在 Github 仓库的每一次 commit 后自动同步到 Gitee 上
2+
name: sync2gitee
23
on:
3-
push: # push 时触发, 主要是为了测试配置有没有问题
4-
schedule:
5-
- cron: '* */24 * * *' # 每天一次, 低碳一点
4+
push:
5+
branches:
6+
- master
67
jobs:
7-
hub-mirror-action:
8+
repo-sync:
9+
env:
10+
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
11+
dst_token: ${{ secrets.GITEE_TOKEN }}
12+
gitee_user: ${{ secrets.GITEE_USER }}
813
runs-on: ubuntu-latest
9-
steps:
10-
- name: Mirror the Github organization repos to Gitee.
11-
- uses: Yikun/hub-mirror-action@master
12-
with:
13-
src: github/knight000
14-
dst: gitee/kni_gitee
15-
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
16-
dst_token: ${{ secrets.GITEE_TOKEN }}
17-
mappings: "trackerslist=>trackerslist_mirror"
18-
static_list: "trackerslist"
19-
account_type: user
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
persist-credentials: false
18+
19+
- name: sync github -> gitee
20+
uses: Yikun/hub-mirror-action@master
21+
if: env.dst_key && env.dst_token && env.gitee_user
22+
with:
23+
# 必选,需要同步的 Github 用户(源)
24+
src: 'github/${{ github.repository_owner }}'
25+
# 必选,需要同步到的 Gitee 用户(目的)
26+
dst: 'gitee/kni_gitee'
27+
# 必选,Gitee公钥对应的私钥,https://gitee.com/profile/sshkeys
28+
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
29+
# 必选,Gitee对应的用于创建仓库的token,https://gitee.com/profile/personal_access_tokens
30+
dst_token: ${{ secrets.GITEE_TOKEN }}
31+
# 如果是组织,指定组织即可,默认为用户 user
32+
# account_type: org
33+
# 直接取当前项目的仓库名
34+
static_list: ${{ github.event.repository.name }}
35+
# 还有黑、白名单,静态名单机制,可以用于更新某些指定库
36+
# static_list: 'repo_name,repo_name2'
37+
# black_list: 'repo_name,repo_name2'
38+
# white_list: 'repo_name,repo_name2'

0 commit comments

Comments
 (0)