diff --git a/.github/workflows/mirroring.yml b/.github/workflows/mirroring.yml new file mode 100644 index 0000000..c06cd73 --- /dev/null +++ b/.github/workflows/mirroring.yml @@ -0,0 +1,14 @@ +name: Mirroring + +on: [push, delete] + +jobs: + GitLab: + runs-on: ubuntu-latest + steps: + - name: Checkout code. + run: git clone --mirror "https://github.com/${GITHUB_REPOSITORY}.git" "${GITHUB_WORKSPACE}" + - name: Get GitLab repository. + run: echo "REPOSITORY_NAME=$(echo "${GITHUB_REPOSITORY}" | sed "s|^${GITHUB_REPOSITORY_OWNER}/||g")" >> "${GITHUB_ENV}" + - name: Mirroring. + run: git push --mirror "https://oauth2:${{ secrets.GITLAB_PERSONAL_ACCESS_TOKEN }}@gitlab.com/DeveloperC/${REPOSITORY_NAME}"