Skip to content

Commit

Permalink
ci: adding GitLab mirroring GitHub Action (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
DeveloperC286 authored Jan 25, 2024
1 parent 7ae96d3 commit 52561a5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/mirroring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Mirroring

on: [push, delete]

concurrency:
group: ${{ github.workflow }}

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}"

0 comments on commit 52561a5

Please sign in to comment.