mirror of
https://github.com/lan-tianxiang/clone_scripts.git
synced 2026-03-24 19:37:40 +08:00
.
This commit is contained in:
42
.github/workflows/repo_sync.yml
vendored
Executable file
42
.github/workflows/repo_sync.yml
vendored
Executable file
@@ -0,0 +1,42 @@
|
||||
# File: .github/workflows/repo-sync.yml
|
||||
name: sync-LXK9301-scripts
|
||||
on:
|
||||
schedule:
|
||||
- cron: '1 0,15 * * *'
|
||||
workflow_dispatch:
|
||||
watch:
|
||||
types: started
|
||||
push:
|
||||
branches: [ master ]
|
||||
repository_dispatch:
|
||||
types: sync-LXK9301-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 LXK9301-scripts
|
||||
uses: repo-sync/github-sync@v2
|
||||
if: env.PAT
|
||||
with:
|
||||
source_repo: "https://gitee.com/lxk0301/jd_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:
|
||||
src: github/LXK9301
|
||||
dst: gitee/lxk0301
|
||||
static_list: "jd_scripts"
|
||||
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
|
||||
dst_token: ${{ secrets.GITEE_TOKEN }}
|
||||
Reference in New Issue
Block a user