Skip to content

Commit

Permalink
Create sync.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
YaKun9 authored Jun 12, 2024
1 parent 58cbb92 commit d6f3426
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,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

0 comments on commit d6f3426

Please sign in to comment.