Giter Site home page Giter Site logo

pixta-dev / repository-mirroring-action Goto Github PK

View Code? Open in Web Editor NEW
237.0 237.0 81.0 15 KB

A GitHub Action for mirroring a repository to another repository

Home Page: https://github.com/marketplace/actions/mirroring-repository

License: MIT License

Dockerfile 28.84% Shell 71.16%

repository-mirroring-action's People

Contributors

naotoomura avatar sam-lin-millerslab avatar trolologuy avatar weeebdev avatar yasaichi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

repository-mirroring-action's Issues

Wrong public key

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?

Can we add config options to include/exclude branches?

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.

push rejected by remote (shallow update not allowed)

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.

[Question] Bitbucket configuration

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 }}

Getting fatal: remote mirror already exists. error when mirroring

I'm getting a

fatal: remote mirror already exists.

error when mirroring.

I'm using self-hosted github runners.

image

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.

Mirroring to CodeCommit fails due to invalid file format

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.

Non default SSH port

How can I define a port other than port 22?

On my server I use another port for ssh access.

Thanks

Failing to mirror repo with file in LFS

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?

Error "fatal: remote mirror already exists."

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 }}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.