-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can mirror-action be used for a pull vs push? #8
Comments
Hi @connecteev this is a great suggestion. I think it's possible to use this project to do this with This sounds like it'd be a common use-case for folks, so I'll try to figure out exactly how to do it and provide an example yml in the README :) |
Thanks @spyoungtech In my case, both the source and destination (REMOTE) repos are on github. I want to be able to mirror / sync all branches from the source to the destination. An example yml would be helpful. |
Understood. For this purpose, you'll probably need to use a personal access token (PAT) with the checkout@v1 action like so - uses: actions/checkout@v1
with:
repository: myAccount/my-read-only-repository
token: ${{ secrets.GitHub_PAT }} # `GitHub_PAT` is a secret contains your PAT. Then the following step, use this repo's parameters as normal, specifying the present repository as the remote. For example - uses: spyoungtech/[email protected]
with:
REMOTE: [email protected]/myAccount/my-repo.git
GIT_SSH_PRIVATE_KEY: ${{ secrets.GIT_SSH_PRIVATE_KEY }}
GIT_SSH_PUBLIC_KEY: ${{ secrets.GIT_SSH_PUBLIC_KEY }}
GIT_SSH_NO_VERIFY_HOST: "true" # or specify GIT_SSH_KNOWN_HOSTS, recommended Just be cautious that mirror-action is capable of triggering other GitHub actions, unless you use |
That is super helpful..thanks so much @spyoungtech! I'll give this a go shortly and report back if I have any issues. Much appreciated. |
Note that if the source repository is not in GitHub, you won't be able to use actions/checkout to read from it. According to this issue, it does not support arbitrary remote repositories like mirror-action does. |
Are there any updates about this ? Even if it would require running a CRON job Found this : https://github.com/thamognya/mirror-git-repo |
@spyoungtech first off thanks for this useful project. Is it possible to use this to mirror a repo as a "Pull" rather than a "Push"?
My understanding is as such:
Can this action be used to "pull" instead? The situation is as such: I have read-only access to a private github repo, and I would like to mirror all branches from that repo into one I own and control. If it's possible, what would the yml config look like?
So far I was trying to use https://github.com/actions/checkout but I probably didnt end up configuring it right. A search led me to your repo.
The text was updated successfully, but these errors were encountered: