name: Mirror to GitLab
on:
push:
branches: ['**'] tags: ['**'] delete:
jobs:
mirror:
name: Push mirror
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Push mirror to GitLab
run: |
git remote add gitlab \
https://oauth2:${GITLAB_TOKEN}@gitlab.com/open-works/oxiflow.git
# Push branches without force — GitLab forbids force-push on the
# default branch and rejects --prune when it would delete it.
git push gitlab \
"refs/heads/*:refs/heads/*"
# Push tags with force so re-created tags are synced correctly.
git push gitlab --force \
"refs/tags/*:refs/tags/*"
env:
GITLAB_TOKEN: ${{ secrets.GITLAB_MIRROR_TOKEN }}