From 958b066755d024e3fcce7645f4178efcf2a8b57a Mon Sep 17 00:00:00 2001 From: Yikun Jiang Date: Wed, 18 Aug 2021 12:18:45 +0800 Subject: [PATCH 1/3] Add cn doc for timeout/mappings --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 72af4d92..8ee90ce2 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,10 @@ steps: - `static_list` 默认为'', 配置后,仅同步静态列表,不会再动态获取需同步列表(黑白名单机制依旧生效),如“repo1,repo2,repo3”。 - `force_update` 默认为false, 配置后,启用git push -f强制同步,**注意:开启后,会强制覆盖目的端仓库**。 - `debug` 默认为false, 配置后,启用debug开关,会显示所有执行命令。 +- `debug` 默认为false, 配置后,启用debug开关,会显示所有执行命令。 +- `debug` 默认为false, 配置后,启用debug开关,会显示所有执行命令。 +- `timeout` 默认为'30m', 用于设置每个git命令的超时时间,'600'=>600s, '30m'=>30 mins, '1h'=>1 hours +- `mappings` 源仓库映射规则,比如'A=>B, C=>CC', A会被映射为B,C会映射为CC,映射不具有传递性。主要用于源和目的仓库名不同的镜像。 ## 举些例子 @@ -142,6 +146,19 @@ steps: timeout: '1h' ``` +#### 同步仓库名不同的镜像(github/yikun/yikun.github.com to gitee/yikunkero/blog) +``` +- name: mirror with mappings + uses: Yikun/hub-mirror-action@mappings + with: + src: github/yikun + dst: gitee/yikunkero + dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} + dst_token: ${{ secrets.GITEE_TOKEN }} + mappings: "yikun.github.com=>blog" + static_list: "yikun.github.com" +``` + ## FAQ - 如何在secrets添加dst_token和dst_key? From ede15308d51fc6d826500a768b6ccaf700b38b6a Mon Sep 17 00:00:00 2001 From: Yikun Jiang Date: Wed, 18 Aug 2021 15:01:07 +0800 Subject: [PATCH 2/3] Update README.md --- README.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/README.md b/README.md index 8ee90ce2..f30bcbd8 100644 --- a/README.md +++ b/README.md @@ -40,8 +40,6 @@ steps: - `static_list` 默认为'', 配置后,仅同步静态列表,不会再动态获取需同步列表(黑白名单机制依旧生效),如“repo1,repo2,repo3”。 - `force_update` 默认为false, 配置后,启用git push -f强制同步,**注意:开启后,会强制覆盖目的端仓库**。 - `debug` 默认为false, 配置后,启用debug开关,会显示所有执行命令。 -- `debug` 默认为false, 配置后,启用debug开关,会显示所有执行命令。 -- `debug` 默认为false, 配置后,启用debug开关,会显示所有执行命令。 - `timeout` 默认为'30m', 用于设置每个git命令的超时时间,'600'=>600s, '30m'=>30 mins, '1h'=>1 hours - `mappings` 源仓库映射规则,比如'A=>B, C=>CC', A会被映射为B,C会映射为CC,映射不具有传递性。主要用于源和目的仓库名不同的镜像。 @@ -146,7 +144,7 @@ steps: timeout: '1h' ``` -#### 同步仓库名不同的镜像(github/yikun/yikun.github.com to gitee/yikunkero/blog) +#### 仓库名不同时同步(github/yikun/yikun.github.com to gitee/yikunkero/blog) ``` - name: mirror with mappings uses: Yikun/hub-mirror-action@mappings From 37fefd5d97d04e8cc970083b0736b675ca7ece21 Mon Sep 17 00:00:00 2001 From: Yikun Jiang Date: Wed, 18 Aug 2021 15:05:43 +0800 Subject: [PATCH 3/3] Update README_en.md --- README_en.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README_en.md b/README_en.md index 87af6393..4655fb14 100644 --- a/README_en.md +++ b/README_en.md @@ -39,6 +39,8 @@ Here is a workflow to mirror the kunpengcompute org repos from Github to Gitee, - `white_list` (optional) the white list, such as “repo1,repo2,repo3”. - `static_list` (optional) Only mirror repos in the static list, but don't get list from repo api dynamically (the white/black list is still available). like 'repo1,repo2,repo3' - `force_update` (optional) Force to update the destination repo, use '-f' flag do 'git push' +- `timeout` (optional) Default is '30m', set the timeout for every git command, like '600'=>600s, '30m'=>30 mins, '1h'=>1 hours +- `mappings` (optional) Default is empty, the source repos mappings, such as 'A=>B, C=>CC', source repo name would be mapped follow the rule: A to B, C to CC. Mapping is not transitive. ## Scenarios @@ -129,6 +131,19 @@ Here is a workflow to mirror the kunpengcompute org repos from Github to Gitee, timeout: '1h' ``` +#### Sync between different repo name(github/yikun/yikun.github.com to gitee/yikunkero/blog) +``` +- name: mirror with mappings + uses: Yikun/hub-mirror-action@mappings + with: + src: github/yikun + dst: gitee/yikunkero + dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} + dst_token: ${{ secrets.GITEE_TOKEN }} + mappings: "yikun.github.com=>blog" + static_list: "yikun.github.com" +``` + ## FAQ - How to use `secrets` to add token and key?