Merge pull request #22 from devchat-ai/sync_github_to_gitlab

Sync GitHub to gitlab
This commit is contained in:
boob.yang 2024-01-03 15:35:09 +08:00 committed by GitHub
commit c83b273e64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

32
.github/workflows/sync-to-gitlab.yml vendored Normal file
View File

@ -0,0 +1,32 @@
name: Sync to GitLab
on:
push:
branches:
- main
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout GitHub repository
uses: actions/checkout@v4
- name: Setup Git
run: |
git config user.name "gh-action"
git config user.email "gh-action@merico.dev"
- name: Add GitLab remote
run: |
git remote add gitlab https://oauth2:${{ secrets.GITLAB_ACCESS_TOKEN }}@gitlab.com/devchat-ai/workflows.git
- name: Retry Command
uses: nick-invision/retry@v2
with:
timeout_minutes: 10
max_attempts: 3
command: |
git fetch gitlab &&
git rebase gitlab/main &&
git push gitlab