This action, together with actions/checkout allows you to mirror a specific branch from your repository with that of another via ssh.
This is equivalent to adding a new remote to your repo and force pushing to a specific branch of the remote.
See action.yml
steps:
- uses: actions/checkout@v4
with:
ref: master # Source branch you want to mirror
fetch-depth: 0 # !important! Fetch full history of the branch !important!
- uses: dreipol/git-mirror-action@master
env:
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
with:
repo: [email protected]/your-repo
user: [email protected]
target_branch: master # Defaults to master, so you could leave this awayRead more about how to create and use encrypted secrets.
There are already a few good actions out there but none allow you to only mirror a specific branch.