Skip to content

Commit

Permalink
adding gitlab push mirroring as test
Browse files Browse the repository at this point in the history
  • Loading branch information
dr4hcu5-jan committed Feb 6, 2024
1 parent 7e60ec7 commit b138759
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/gitlab-mirror.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Mirror Repository
on: [push]

jobs:
mirror-repo:
runs-on: ubuntu-latest
steps:
- name: Try creating repository
run: |
REPO_CREATION_STATUS=$(curl -X POST --oauth2-bearer "${{ secrets.MIRROR_PASSWORD }}" "${{ secrets.MIRROR_HOST }}/api/v4/projects?name=${{ github.event.repository.name }}&namespace_id=14014")
if [ "$REPO_CREATION_STATUS" -eq 201 ]; then
echo "Repository created"
elif [ "$REPO_CREATION_STATUS" -eq 400 ]; then
echo "Repository already existing"
else
echo "Unknown error occurred during mirroring setup"
exit 1
fi
- uses: actions/checkout@v5
with:
fetch-depth: 0
- uses: yesolutions/mirror-action@master
with:
REMOTE: ${{ secrets.MIRROR_HOST }}/wisdom-oss-mirror/${{ github.event.repository.name }}
GIT_USERNAME: ${{ secrets.MIRROR_USER }}
GIT_PASSWORD: ${{ secrets.MIRROR_PASSWORD }}
PUSH_ALL_REFS: true

0 comments on commit b138759

Please sign in to comment.