This action pushes all commits in the branch that this action is run on into any remote git repository.
Check out a sample workflow.
Be sure to run the actions/checkout action in a step before
this action so that the git repository is initialized.
# File: .github/workflows/mirror.yml
- uses: net-engine/github-repository-sync-action@v1
with:
# The SSH private key for SSH connection to the target repository.
# We strongly recommend saving this value as a GitHub Secret and using deploy
# keys within the target repository
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
# Optional content to put in .ssh/config, see notes
ssh_config: ${{ vars.SSH_CONFIG }}
# The SSH-based URL to the target repository
target_repo_url: git@github.com:net-engine/github-repository-sync-action-test.gitInspired by the following actions which may be more suitable for your workflow, e.g. syncing any source repository and branch to any destination, or copying all branches.
Support for an ssh config makes it possible to set ssh connection details such as the username dynamically.
For example, using AWS CodeCommit requires a custom username which can be passed in a variable SSH_CONFIG containing:
Host git-codecommit.<region>.amazonaws.com
User <Your-SSH-Key-ID> (such as APKAEIBAERJR2EXAMPLE)
IdentityFile /root/.ssh/id_rsa
- Support for any to and from branch, similar to actions/checkout@v2
- Make SSH key-based authentication optional to support username/password authentication
- Support for the
pull_requestevent
The scripts and documentation in this project are released under the MIT License