-
Notifications
You must be signed in to change notification settings - Fork 1
33 lines (30 loc) · 977 Bytes
/
gitlab.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
name: GitLab
on:
push:
branches:
- master
tags:
- '*'
jobs:
Sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Sync to GitLab
env:
GITLAB_USERNAME: ${{ secrets.GITLAB_USERNAME }}
GITLAB_TOKEN: ${{ secrets.GITLAB_TOKEN }}
GITLAB_REPO: ${{ secrets.GITLAB_REPO }}
GITLAB_EMAIL: ${{ secrets.GITLAB_EMAIL }}
GITLAB_NAME: ${{ secrets.GITLAB_NAME }}
run: |
git config user.name "$GITLAB_NAME"
git config user.email "$GITLAB_EMAIL"
git remote add gitlab https://$GITLAB_USERNAME:$GITLAB_TOKEN@$GITLAB_REPO
git checkout master
git fetch -q gitlab master 2>&1 | sed "s|https://$GITLAB_REPO|https://***|g"
git rebase gitlab/master
git push gitlab master --tags 2>&1 | sed "s|https://$GITLAB_REPO|https://***|g"