forked from AQ-0419/GoodHolidays-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (44 loc) · 1.62 KB
/
repo_sync.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File: .github/workflows/repo-sync.yml
name: sync-Sunert-scripts
on:
schedule:
- cron: '1 0,12,22 * * *'
workflow_dispatch:
watch:
types: started
repository_dispatch:
types: sync-Sunert-scripts
jobs:
repo-sync:
env:
PAT: ${{ secrets.PAT }} #此处PAT需要申请,教程详见:https://www.jianshu.com/p/bb82b3ad1d11
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }} # 我自己同步到gitee使用,其他人可忽略
runs-on: ubuntu-latest
if: github.event.repository.owner.id == github.event.sender.id
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: sync Sunert-scripts
uses: repo-sync/github-sync@v2
if: env.PAT
with:
source_repo: "https://github.com/Sunert/Scripts.git"
source_branch: "master"
destination_branch: "master"
github_token: ${{ secrets.PAT }}
# 我自己同步到gitee使用,其他人可忽略
- name: sync github -> gitee
uses: Yikun/hub-mirror-action@master
if: env.dst_key
with:
# 必选,需要同步的Github用户(源)
src: github/Sunert
# 必选,需要同步到的Gitee的用户(目的)
dst: gitee/Sunert
# 必选,更新指定库名字
static_list: "Scripts"
# 必选,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 }}