From 43eaa792ec263c8c65b0716fb3b43cb4b802adab Mon Sep 17 00:00:00 2001 From: lan-tianxiang <42911023+lan-tianxiang@users.noreply.github.com> Date: Fri, 26 Mar 2021 14:53:56 +0800 Subject: [PATCH] Update gitee.yml --- .github/workflows/gitee.yml | 50 +++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/.github/workflows/gitee.yml b/.github/workflows/gitee.yml index 9d047a5..4b1558c 100644 --- a/.github/workflows/gitee.yml +++ b/.github/workflows/gitee.yml @@ -1,29 +1,31 @@ -name: Gitee repos mirror periodic job +name: sync to gitee on: -# 如果需要PR触发把push前的#去掉 -# push: schedule: - # 每天北京时间9点跑 - - cron: '0 1 * * *' + - cron: '1 0,15 * * *' + workflow_dispatch: + watch: + types: started + push: + branches: [ master ] + repository_dispatch: + types: sync-LXK9301-scripts jobs: - build: + repo-sync: + env: + dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} # 我自己同步到gitee使用,其他人可忽略 runs-on: ubuntu-latest + if: github.event.repository.owner.id == github.event.sender.id steps: - - name: Mirror the Github organization repos to Gitee. - uses: Yikun/gitee-mirror-action@master - with: - # 必选,需要同步的Github用户(源) - src: github/lan-tianxiang - # 必选,需要同步到的Gitee的用户(目的) - dst: gitee/highdimen - # 必选,Gitee公钥对应的私钥,https://gitee.com/profile/sshkeys - dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} - # 必选,Gitee对应的用于创建仓库的token,https://gitee.com/profile/personal_access_tokens - dst_token: ${{ secrets.GITEE_TOKEN }} - clone_style: "ssh" - # 如果是组织,指定组织即可,默认为用户user - # account_type: org - # 还有黑、白名单,静态名单机制,可以用于更新某些指定库 - static_list: "clone_scripts" - # black_list: 'repo_name,repo_name2' - # white_list: 'repo_name,repo_name2' + - uses: actions/checkout@v2 + with: + persist-credentials: false + + - name: sync github -> gitee + uses: Yikun/hub-mirror-action@master + with: + src: github/lan-tianxiang + dst: gitee/highdimen + static_list: "clone_scripts" + dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} + dst_token: ${{ secrets.GITEE_TOKEN }} + clone_style: "ssh"