Skip to content

Commit 3e1df52

Browse files
author
ziye12
authored
Update sync-repo.yml
1 parent 0bc6838 commit 3e1df52

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

.github/workflows/sync-repo.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
1-
name: 同步上游仓库
1+
# File: .github/workflows/repo-sync.yml
2+
name: sync-ziye12-JavaScript
23
on:
34
schedule:
4-
- cron: '0 */2 * * *'
5+
- cron: '1 */3 * * *'
6+
workflow_dispatch:
57
watch:
68
types: started
79
repository_dispatch:
8-
types: sync-repo
10+
types: sync-ziye12-JavaScript
911
jobs:
1012
repo-sync:
1113
env:
1214
PAT: ${{ secrets.PAT }} #此处PAT需要申请,教程详见:https://www.jianshu.com/p/bb82b3ad1d11
15+
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} # 我自己同步到gitee使用,其他人可忽略
1316
runs-on: ubuntu-latest
1417
if: github.event.repository.owner.id == github.event.sender.id
1518
steps:
@@ -23,5 +26,22 @@ jobs:
2326
with:
2427
source_repo: "https://github.com/ziye12/JavaScript.git"
2528
source_branch: "master"
26-
destination_branch: "main"
29+
destination_branch: "master"
2730
github_token: ${{ secrets.PAT }}
31+
# 我自己同步到gitee使用,其他人可忽略
32+
- name: sync github -> gitee
33+
uses: Yikun/hub-mirror-action@master
34+
if: env.dst_key
35+
with:
36+
# 必选,需要同步的Github用户(源)
37+
src: github/Sunert
38+
# 必选,需要同步到的Gitee的用户(目的)
39+
dst: gitee/Sunert
40+
# 必选,更新指定库名字
41+
static_list: "Scripts"
42+
43+
# 必选,Gitee公钥对应的私钥,https://gitee.com/profile/sshkeys
44+
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
45+
46+
# 必选,Gitee对应的用于创建仓库的token,https://gitee.com/profile/personal_access_tokens
47+
dst_token: ${{ secrets.GITEE_TOKEN }}

0 commit comments

Comments
 (0)