forked from MaaAssistantArknights/MaaAssistantArknights
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.15 KB
/
sync_with_upstream.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: Sync Fork
on:
schedule:
- cron: '*/30 * * * *' # Every 30 minutes
workflow_dispatch: # 允许手动触发工作流
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout fork repository
uses: actions/checkout@v2
with:
fetch-depth: 0
path: 'fork-repo'
- name: Checkout upstream repository
uses: actions/checkout@v2
with:
repository: 'MaaAssistantArknights/MaaAssistantArknights'
fetch-depth: 0
path: 'upstream-repo'
- name: Rsync files excluding workflows
run: |
rsync -av --exclude='.github/workflows/' upstream-repo/ fork-repo/
- name: Commit and Push changes to fork
env:
GIT_AUTHOR_NAME: ${{ github.actor }}
GIT_AUTHOR_EMAIL: ${{ github.actor }}@users.noreply.github.com
GIT_COMMITTER_NAME: ${{ github.actor }}
GIT_COMMITTER_EMAIL: ${{ github.actor }}@users.noreply.github.com
run: |
cd fork-repo
git add .
git commit -m "Sync with upstream excluding workflows" || echo "No changes to commit"
git push -f https://github.com/Zachary-Muadib/MaaAssistantArknights.git dev