okyyds-sync #601
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 工作流名称 | |
name: okyyds-sync | |
# 触发工作流事件 | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
# 格林威治时间 (GMT) 每日01时开始执行 | |
- cron: '0 1 * * *' | |
# 手动触发 | |
workflow_dispatch: | |
watch: | |
# started触发 | |
types: started | |
repository_dispatch: | |
# 上游作者库名 | |
types: sync-okyyds/yyds | |
# 工作流运行由可以顺序或并行运行的一个或多个作业组成 | |
jobs: | |
repo-sync: | |
env: | |
PAT: ${{ secrets.PAT }} | |
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 okyyds/yyds | |
uses: repo-sync/github-sync@v2 | |
if: env.PAT | |
with: | |
# 需要 clone 的上游仓库地址 | |
source_repo: "https://github.com/okyyds/yyds.git" | |
# 需要clone上游作者的分支名 | |
source_branch: "master" | |
# 需要clone到自己项目的分支名 | |
destination_branch: "okyyds" | |
github_token: ${{ secrets.PAT }} |