Skip to content

Update push_gitlab.yml #5

Update push_gitlab.yml

Update push_gitlab.yml #5

Workflow file for this run

name: Mirror to GitLab
on:
push:
branches:
- '*'
jobs:
mirror_to_gitlab:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
with:
ref: ${{ github.event.ref }}
- name: Set up Git
run: |
git config --global user.name 'GitHub Actions'
git config --global user.email '[email protected]'
- name: Add GitLab remote
run: |
git remote add gitlab https://oauth2:${{ secrets.GITLAB_TOKEN }}@${{ secrets.GITLAB_URL }}
- name: Fetch all branches from GitLab
run: |
git fetch gitlab --prune
git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
- name: Push all branches to GitLab
run: |
git push gitlab --all