Mirror a repository using repository-mirroring-action
mainUse pixta-dev/repository-mirroring-action to mirror all commits, branches, and tags from your source repository to a target repository on platforms like GitHub, GitLab, BitBucket, or AWS CodeCommit.
Important Considerations:
- Settings: Only commits, branches, and tags are copied. Other repository settings (like branch protection rules or webhooks) will not be mirrored.
- Default Branch: You must manually verify which branch is set as the 'default branch' on the target repository after the first mirroring operation.
- Checkout Requirement: You must use
actions/checkoutwithfetch-depth: 0before calling this action to ensure all history is available for mirroring.
name: Mirroring
on: [push, delete]
jobs:
to_target:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url: git@gitlab.com:<username>/<target_repository_name>.git
ssh_private_key: ${{ secrets.TARGET_SSH_PRIVATE_KEY }}