Skip to content

Add GitLab mirroring pipeline #1

Add GitLab mirroring pipeline

Add GitLab mirroring pipeline #1

Workflow file for this run

name: Mirror to GitLab
on:
workflow_dispatch:
push:
branches:
- '**'
jobs:
mirror:
runs-on: self-hosted
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push to GitLab
run: |
for branch in $(git branch -r | grep -v '\->'); do
branch_name=${branch#origin/}
echo "Processing branch: $branch_name"
if git show-ref --verify --quiet refs/heads/$branch_name; then
echo "Branch '$branch_name' already exists, checking out..."
git checkout $branch_name
else
git checkout -b $branch_name $branch
fi
git remote add gitlab https://gdb:${{ secrets.GITLAB_TOKEN }}@liis-it.gitlab.yandexcloud.net/archive/mobile/simple-react-native.git
git push -u gitlab $branch_name
git remote remove gitlab
git checkout gitlab/mirror
done