-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (25 loc) · 926 Bytes
/
sync.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
name: Sync from Gitea repository
on:
schedule:
- cron: '0 * * * *' # 每小时运行一次
workflow_dispatch: # 手动触发
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout this repository
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Configure Git
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: Clone Gitea repository
run: |
git clone --mirror https://${{ secrets.GITEA_REPO }}:${{ secrets.GITEA_TOKEN }}@gitea.snat.top/seesharper/SageTools.git gitea_repo
- name: Sync changes to GitHub
run: |
cd gitea_repo
git remote set-url --push origin https://${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
git push --mirror