pixta-dev / repository-mirroring-action

A GitHub Action for mirroring a repository to another repository
https://github.com/marketplace/actions/mirroring-repository
MIT License
240 stars 82 forks source link

Getting fatal: remote mirror already exists. error when mirroring #17

Closed alessandro-mariotti-zupit closed 1 year ago

alessandro-mariotti-zupit commented 1 year ago

I'm getting a

fatal: remote mirror already exists.

error when mirroring.

I'm using self-hosted github runners.

image

My action is:

name: Mirroring

on:
  push:
    branches: [ "main", "release/*" ]
    tags:
      - "v[0-9]+.[0-9]+.[0-9]+"
  delete:
    branches: [ "main", "release/*" ]
    tags:
      - "v[0-9]+.[0-9]+.[0-9]+"

jobs:
  to_gitlab:
    runs-on: ['pinga', 'pipeline', 'native']
    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0
      - uses: pixta-dev/repository-mirroring-action@v1
        with:
          target_repo_url:
            a-very-nice-private-repo
          ssh_private_key:
            ${{ secrets.GITLAB_SSH_PRIVATE_KEY }}

I've tried adding:

- run: git remote remove mirror || true

after the checkout phase but I get permission errors because the pixta-dev/repository-mirroring-action runs as Docker, which has different permissions on file system.