forked from jyoung8607/openpilot
-
Notifications
You must be signed in to change notification settings - Fork 10
46 lines (39 loc) · 1.44 KB
/
mirror_to_gitlab.yaml
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
40
41
42
43
44
45
46
name: Mirror to GitLab
on:
push:
delete:
workflow_dispatch: # This enables manual triggering
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Wait for other instances of this workflow to conclude
uses: softprops/turnstyle@8db075d65b19bf94e6e8687b504db69938dc3c65
with:
same-branch-only: 'true'
abort-after-seconds: 300
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Repository
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
fetch-depth: 0 # Fetch full history
- name: Set up Git
run: |
git config --global user.name 'GitHub Action'
git config --global user.email '[email protected]'
- name: Set up SSH
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: Add GitLab public keys
run: |
ssh-keyscan -H gitlab.com >> ~/.ssh/known_hosts
# Note: If you have issues with "push rejected missing LFS" or something make sure you disabled LFS on the GITLAB repo if you intend to use a different LFS repo other than the target repo.
- name: Sync and commit changes
id: sync-and-commit
run: |
# Add GitLab remote
git remote add gitlab [email protected]:sunnypilot/sunnyhaibin/sunnypilot-github-mirror.git
git push -u --force gitlab ${{ github.ref }}