LotteryAutoScript/.github/workflows/sync.yml
2021-01-25 22:21:15 +08:00

28 lines
846 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: 'Automatic sync'
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
watch:
types: started
repository_dispatch:
types: repo-sync
jobs:
repo-sync:
env:
PAT: ${{ github.event.client_payload.PAT || secrets.PAT }} #此处PAT需要申请教程详见https://www.jianshu.com/p/bb82b3ad1d11
runs-on: ubuntu-latest
if: github.event.repository.owner.id == github.event.sender.id
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- name: 开始自动同步
uses: repo-sync/github-sync@v2
if: env.PAT
with:
source_repo: "https://github.com/shanmite/LotteryAutoScript.git"
source_branch: "main"
destination_branch: "main"
github_token: ${{ github.event.client_payload.PAT || secrets.PAT }}