pixta-dev / repository-mirroring-action Goto Github PK
View Code? Open in Web Editor NEWA GitHub Action for mirroring a repository to another repository
Home Page: https://github.com/marketplace/actions/mirroring-repository
License: MIT License
A GitHub Action for mirroring a repository to another repository
Home Page: https://github.com/marketplace/actions/mirroring-repository
License: MIT License
I am trying to push to mirror to a different repository on the same account on github. Problem is, the wrong public key is used to check for authentication. How doe I fix this?
I met
remote: GitLab: You are not allowed to force push code to a protected branch on this project.
First of all, I think this action is great, thank you for making it!
As title suggests, I would love if we could have an option for include/exclude branches for mirroring. E.g. I only want to backup my master branch to gitlab whenever something gets merged/pushed to master in github.
Er78RCMkkKjeNXWDJiWvwpL3fACdQ4Uo14FSThCFTRHYF3CaoriaFtc1qWw8xtX1RdutEoo6oyTbch
This isn't in the examples.
When trying to run the worflow that worked perfectly fine before, we ran into an error:
To <repo>
! [remote rejected] origin/master -> master (shallow update not allowed)
error: failed to push some refs to <repo>
I searched on stackoverflow and found that it was caused by a shallow clone. But I don't have any idea of how to fix it, I don't event know if I can fix it.
I'm sorry cus i'm still very newbie with deployments.
How would you configure Bitbucket to accept the private ssh key to have writing access?
Here's my action
# Deploy to BitBucket repos
name: Deploy to BitBucket Wordpress Repositories
# You may pin to the exact commit or the version.
# uses: pixta-dev/repository-mirroring-action@02f1627ade9e6b3b69e6a6d4fe8bc997474f48d1
# uses: pixta-dev/repository-mirroring-action@v1
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
deploy_to_test_repo:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v1
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url:
[email protected]:username/reponame.git
ssh_private_key:
${{ secrets.BITBUCKET_SSH_PRIVATE_KEY }}
I started to use this action but face issues after the first run everything went through.
`
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Connection closed by 135.125.231.159 port 22
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
`
The output can be found here too: https://github.com/digitalservicebund/digitalservicebund.github.io/actions/runs/3642799602/jobs/6150435802
Has anyone this behavior before?
Your repo is very usefully.
We expect you can modify the program to support [actions/[email protected]].
Thank you!
I'm getting a
fatal: remote mirror already exists.
error when mirroring.
I'm using self-hosted github runners.
My action is:
name: Mirroring
on:
push:
branches: [ "main", "release/*" ]
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
delete:
branches: [ "main", "release/*" ]
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
jobs:
to_gitlab:
runs-on: ['pinga', 'pipeline', 'native']
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url:
a-very-nice-private-repo
ssh_private_key:
${{ secrets.GITLAB_SSH_PRIVATE_KEY }}
I've tried adding:
- run: git remote remove mirror || true
after the checkout phase but I get permission errors because the pixta-dev/repository-mirroring-action runs as Docker, which has different permissions on file system.
If I mirror to another GitHub repo, are the action will be triggered and create an endless loop?
It would be nice if this can handle private with passphase
Set up this action on a private repository in an organization. Added the following organization secrets:
CODECOMMIT_SSH_PRIVATE_KEY
- SSH key from IAM console.
CODECOMMIT_SSH_PRIVATE_KEY_ID
- SSH Key ID from IAM console.
This is the error log I'm getting:
debug1: no match: AWSCodeCommit TW9uLCAxMCBKYW4gMjAyMiAxNzo1OToxOSArMDAwMDHevtTHzYh9LJq0+7OyPo2jDU2CoWI1jmByylPWLH0uD0xkSmFpYUJaV09KZzNNdldndGY0K2t2NFlPZnhQcCtSeitWUFV3endRV2c9
debug1: Authenticating to git-codecommit.us-east-2.amazonaws.com:22 as '***'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: diffie-hellman-group-exchange-sha256
debug1: kex: host key algorithm: ssh-rsa
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(2048<8192<8192) sent
debug1: got SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: got SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Server host key: ssh-rsa SHA256:3lBlW2g5xn/NA2Ck6dyeJIrQOWvn7n8UEs56fG6ZIzQ
Warning: Permanently added 'git-codecommit.us-east-2.amazonaws.com,52.95.20.253' (RSA) to the list of known hosts.
debug1: rekey out after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 4294967296 blocks
debug1: Will attempt key: /github/home/.ssh/id_rsa explicit
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /github/home/.ssh/id_rsa
Load key "/github/home/.ssh/id_rsa": invalid format
debug1: No more authentication methods to try.
***@git-codecommit.us-east-2.amazonaws.com: Permission denied (publickey).
fatal: Could not read from remote repository.
How can I define a port other than port 22?
On my server I use another port for ssh access.
Thanks
I'm mirroring a repo from Github to Gitlab.
The Github repo has a file in LFS.
The Gitlab repo has Git Large File Storage (LFS)
option enabled
Yet I'm getting this issue:
Locking support detected on remote "mirror". Consider enabling it with:
$ git config lfs.https://gitlab.com/[my gitlab repo].git/info/lfs.locksverify true
LFS upload failed:
(missing) assets/very_large_file.txt ([file hash])
hint: Your push was rejected due to missing or corrupt local objects.
hint: You can disable this check with: 'git config lfs.allowincompletepush true'
In my Github action,
- uses: pixta-dev/[email protected]
I saw there is a PR to add support for LFS, but I don't know if it's in the current action version.
Do you have suggestions on how to solve this problem?
Not sure what's going on, but it looks like the action uses hardcoded remote name.
And somehow remote is preserved between action executions on self-hosted runners.
The first time action runs just fine, but the next time it runs on the same runner node - it fails with "fatal: remote mirror already exists."
The setup is pretty basic:
name: Mirror to XXX
on:
push:
branches:
- master
jobs:
mirror-it:
runs-on: self-hosted
steps:
- uses: actions/checkout@v2
with:
persist-credentials:
false
fetch-depth: 0
- uses: pixta-dev/repository-mirroring-action@v1
with:
target_repo_url:
[email protected]:xxx/clone.git
ssh_private_key:
${{ secrets.MIRROR_PRIVATE_KEY }}
Can we enhance to allow usage of passphrase encrypted SSH connectivity with remote repo ?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.