Yikun / hub-mirror-action

一个Github Action,用于在Github和Gitee之间同步代码。Action for mirroring repos between Hubs (like Github and Gitee).
MIT License
633 stars 173 forks source link

Add dst_visibility support #160

Open Yikun opened 2 years ago

Yikun commented 2 years ago

Due some well known issue of gitee repo policy, we have to add a friendly parameter to support mirror the repo as private repo.

Take below yaml as example:

- name: Mirror the Github organization repos to Gitee.
  uses: Yikun/hub-mirror-action@master
  with:
    src: github/Yikun
    dst: gitee/yikunkero
    dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
    dst_token:  ${{ secrets.GITEE_TOKEN }}
    force_update: true
    debug: true
    # mirror hashes and simple-spring repo
    static_list: 'hashes,simple-spring'
    # these repos will be mirrored as private repo
    dst_visibility: 'private'

This will help to create mirror as private repo.

Close:

Related: https://github.com/Yikun/hub-mirror-action/issues/38

CO-AUTHORED-BY: @dislazy

Yikun commented 2 years ago

cc @yi-Xu-0100 @Zephyr5 @OxalisCu @ufoozhenghao @xiexianbin @sunleonx @appotry

Would you mind have a test? I cc the people who was involved in related issue.

- name: Use specific branch.
  uses: Yikun/hub-mirror-action@dst_visibility
sean3306 commented 2 years ago

Convenient. How do I configure it? Can I communicate in Chinese

Yikun commented 2 years ago

@sunleonx 可以哈,参考PR描述里的例子

- name: Mirror the Github organization repos to Gitee.
  uses: Yikun/hub-mirror-action@dst_visibility
  with:
    src: github/Yikun
    dst: gitee/yikunkero
    dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
    dst_token:  ${{ secrets.GITEE_TOKEN }}
    force_update: true
    debug: true
    # mirror hashes and simple-spring repo
    static_list: 'hashes,simple-spring'
    # these repos will be mirrored as private repo
    dst_visibility: 'private'
    # if need read src private repo, pls use ssh clone style, and set dst_key to github and gitee
    clone_style: 'ssh'
sean3306 commented 2 years ago

还是存在同样的问题

image
sean3306 commented 2 years ago
sean3306 commented 2 years ago

目前仓库属于github的私有仓库和gitee企业版本的私有仓库

Yikun commented 2 years ago
    # if need read src private repo, pls use ssh clone style, and set dst_key to github and gitee
    clone_style: 'ssh'

如果需要读取private仓,再加上clone_style @sunleonx

sean3306 commented 2 years ago
image