Skip to content

Commit d4b1eab

Browse files
committed
docs: clarify key requirements
1 parent 0d6f36c commit d4b1eab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ steps:
3939
#### 必选参数
4040
- `src` 需要被同步的源端账户名,如github/kunpengcompute,表示Github的kunpengcompute账户。
4141
- `dst` 需要同步到的目的端账户名,如gitee/kunpengcompute,表示Gitee的kunpengcompute账户。
42-
- `src_key` 用于在源端拉取代码的私钥,对应公钥需配置在源端。`src_key` 优先于 `private_key`
4342
- `dst_key` 用于在目的端推送代码的私钥,对应公钥需配置在目的端。`dst_key` 优先于 `private_key`
4443
- `dst_token` 创建仓库的API tokens, 用于自动创建不存在的仓库,Github可以在[这里](https://github.com/settings/tokens)找到,Gitee可以在[这里](https://gitee.com/profile/personal_access_tokens)找到,Gitlab可以在[这里](https://gitlab.com/-/user_settings/personal_access_tokens)找到(Required scopes: api, read_api, read_repository, write_repository)。
4544

46-
密钥规则:必须同时提供 `src_key``dst_key`,或提供 `private_key` 作为通用私钥。建议优先使用独立的 `src_key`/`dst_key``private_key` 仅作为兜底。
45+
密钥规则:`dst_key` 必须提供,除非设置了 `private_key`。当 `clone_style=ssh` 时,需要提供 `src_key``private_key`。建议优先使用独立的 `src_key`/`dst_key``private_key` 仅作为兜底。
4746

4847
#### 可选参数
48+
- `src_key` 用于在源端拉取代码的私钥,对应公钥需配置在源端。`src_key` 优先于 `private_key`。当 `clone_style=ssh` 时必需(除非提供 `private_key`)。
4949
- `private_key` 通用私钥(可选)。当 `src_key``dst_key` 为空时使用。
5050
- `account_type` 默认为user,源和目的的账户类型,可以设置为org(组织)、user(用户)或者group(组),该参数支持**同类型账户**(即组织到组织,或用户到用户,或组到组)的同步。如果源目的仓库是不同类型,请单独使用`src_account_type``dst_account_type`配置。
5151
- `src_account_type` 默认为`account_type`,源账户类型,可以设置为org(组织)、user(用户)或者group(组)。

README_en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ More than [100+](https://github.com/search?p=2&q=hub-mirror-action+%22account_ty
3838
#### Required
3939
- `src` source account, such as `github/kunpengcompute`, is the Github kunpengcompute account.
4040
- `dst` Destination account, such as `/kunpengcompute`, is the Gitee kunpengcompute account.
41-
- `src_key` the private key used to fetch code from source. The public key must be added to the source side. `src_key` takes precedence over `private_key`.
4241
- `dst_key` the private key used to push code to destination. The public key must be added to the destination side. `dst_key` takes precedence over `private_key`.
4342
- `dst_token` the API token to create non-existent repo, You can get Github token in [here](https://github.com/settings/tokens), and the Gitee in [here](https://gitee.com/profile/personal_access_tokens). and for GitLab in [here](https://gitlab.com/-/user_settings/personal_access_tokens) ,and for GitCode in [here](https://gitcode.com/setting/token-classic) (Required scopes: api, read_api, read_repository, write_repository).
4443

45-
Key rule: provide both `src_key` and `dst_key`, or provide `private_key` as a common fallback. Prefer separate `src_key`/`dst_key` for least privilege.
44+
Key rule: `dst_key` is required unless `private_key` is set. When `clone_style=ssh`, provide `src_key` or `private_key`. Prefer separate `src_key`/`dst_key` for least privilege.
4645

4746
#### Optional
47+
- `src_key` the private key used to fetch code from source. The public key must be added to the source side. `src_key` takes precedence over `private_key`. Required when `clone_style=ssh` unless `private_key` is set.
4848
- `private_key` (optional) common private key. Used when `src_key` or `dst_key` is empty.
4949
- `account_type` (optional) default is `user`, the account type of src and dst account, can be set to `org` or `user`,For GitLab: can be set to `group` or `user`,only support mirror between same account type (that is "org to org" or "user to user" or "group to group"). if u wanna mirror difference account type, use the `src_account_type` and `dst_account_type` please.
5050
- `src_account_type` (optional) default is `account_type`, the account type of src account, can be set to `org` or `user` or `group`.

0 commit comments

Comments
 (0)