Skip to content

Test CI with protected GitLab branch #63

Test CI with protected GitLab branch

Test CI with protected GitLab branch #63

Workflow file for this run

name: Sync GitLab
on:
push:
branches: [ "mvn-multimodules" ]
workflow_dispatch:
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Git
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
git config --global pull.rebase false
git config --global pull.rebase true
git config --global pull.ff only
- name: Fetch all branches
run: git fetch --all
- name: Checkout mvn-multimodules branch
run: git checkout mvn-multimodules
- name: Sync GitLab
env:
GITLAB_REPO: ${{ secrets.GITLAB_REPO }}
GITLAB_ACCESS_TOKEN: ${{ secrets.GITLAB_ACCESS_TOKEN }}
run: |
git remote add gitlab "https://oauth2:${GITLAB_ACCESS_TOKEN}@${GITLAB_REPO}"
git pull gitlab mvn-multimodules --rebase
git push gitlab mvn-multimodules