-
Notifications
You must be signed in to change notification settings - Fork 93
39 lines (38 loc) · 1.28 KB
/
syncGit.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
name: 1获取最新脚本
on:
schedule:
- cron: '50 */3 * * *'
workflow_dispatch:
watch:
types: started
repository_dispatch:
types: sync-1908002701-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 1908002701-scripts
uses: repo-sync/github-sync@v2
if: env.PAT
with:
source_repo: "https://github.com/1908002701/JD.git"
source_branch: "main"
destination_branch: "main"
github_token: ${{ secrets.PAT }}
# 我自己同步到gitee使用,其他人可忽略
- name: sync github -> gitee
uses: Yikun/hub-mirror-action@master
if: env.dst_key
with:
src: ${{ secrets.SRC_USER }}
dst: ${{ secrets.DST_USER }}
static_list: "JD"
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
dst_token: ${{ secrets.GITEE_TOKEN }}