Sign inSign up

guilhermebresser/github-mirror

By guilhermebresser

•Updated almost 6 years ago

Mirror repo to another GIT

Image
0

124

guilhermebresser/github-mirror repository overview

⁠Git Mirror Action

A GitHub Action for mirroring a git repository⁠ to another location via SSH.

⁠Inputs

⁠source-repo

Required SSH URLs of the source repo.

⁠destination-repo

Required SSH URLs of the destination repo.

⁠Environment variables

SSH_PRIVATE_KEY: Create a SSH key⁠ which has access to both repositories. On GitHub they are called "deploy keys". Store the private key as a secret⁠ and use it in your workflow as seen in the example usage below.

⁠Example workflow

name: Mirror to Bitbucket Repo

on: [ push, delete, create ]

jobs:
  git-mirror:
    runs-on: ubuntu-latest
    steps:
      - uses: wearerequired/git-mirror-action@v1
        env:
          SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
        with:
          source-repo: '[email protected]:wearerequired/swisscom-magazine.git'
          destination-repo: '[email protected]:wearerequired/git-mirror-action.git'

⁠Docker

docker run --rm -e "SSH_PRIVATE_KEY=$(cat ~/.ssh/id_rsa)" $(docker build -q .) "$SOURCE_REPO" "$DESTINATION_REPO"

⁠License

The Dockerfile and associated scripts and documentation in this project are released under the MIT License⁠.

Tag summary

Content type

Image

Digest

Size

12.5 MB

Last updated

almost 6 years ago

docker pull guilhermebresser/github-mirror