Skip to content

Action for synchronizing a git branch to another location (Bitbucket, GitHub, GitLab, etc.) using SSH.

License

Notifications You must be signed in to change notification settings

zent-contrib/sync-git-branch

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sync Git Branch Action

A GitHub Action for synchronizing a git branch to another location via SSH.

Inputs

Name Description Default Required
source-branch Branch name in the source repository Yes
destination-repo SSH URL of the destination repository Yes
source-repo SSH URL of the source repository The respository this action runs in No
destination-branch Branch name in the destination repository Same as source-branch No

Environment variables

SSH_PRIVATE_KEY: Create a SSH key without a passphrase which has access to both repositories.

On GitHub you should add the public key to repository "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: Sync main branch to Bitbucket

on: [push, delete, create]

jobs:
  git-mirror:
    runs-on: ubuntu-latest
    steps:
      - uses: zent-contrib/git-branch-sync-action@v1
        env:
          SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
        with:
          source-branch: main
          destination-repo: "[email protected]:<org>/<repo>.git"

About

Action for synchronizing a git branch to another location (Bitbucket, GitHub, GitLab, etc.) using SSH.

Resources

License

Stars

Watchers

Forks

Packages

No packages published