mirror of
https://github.com/shanmiteko/LotteryAutoScript.git
synced 2026-06-12 21:03:13 +08:00
29 lines
884 B
YAML
29 lines
884 B
YAML
# File: .github/workflows/repo-sync.yml
|
||
name: 自动同步
|
||
on:
|
||
schedule:
|
||
- cron: '0 20 * * *'
|
||
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 }} |