You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
mirror-repository
v0.3.0
A GitHub Action for mirroring your commits to a different remote repository
This project is mirrored on GitLab
For example, this project uses the following workflow to mirror from GitHub to GitLab
on: [push]
...
steps:
- uses: actions/checkout@v1
- uses: spyoungtech/mirror-action@master
with:
REMOTE: 'https://gitlab.com/spyoungtech/mirror-action.git'
GIT_USERNAME: spyoungtech
GIT_PASSWORD: ${{ secrets.GIT_PASSWORD }}
Be sure to set the GIT_PASSWORD
secret in your repo secrets settings.
NOTE: by default, all branches are pushed. If you want to avoid
this behavior, set PUSH_ALL_REFS: "false"
You can further customize the push behavior with the GIT_PUSH_ARGS
parameter.
By default, this is set to --tags --force --prune
If something goes wrong, you can debug by setting DEBUG: "true"
Pretty much the same, but use GIT_SSH_PRIVATE_KEY
steps:
- uses: actions/checkout@v1
- uses: spyoungtech/mirror-action@master
with:
REMOTE: 'https://gitlab.com/spyoungtech/mirror-action.git'
GIT_USERNAME: spyoungtech
GIT_SSH_PRIVATE_KEY: ${{ secrets.GIT_SSH_KEY }}
Be sure you set the GET_SSH_KEY
in your repo secrets settings.