GithubHelp home page GithubHelp logo

nordfogel / mirror-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yesolutions/mirror-action

0.0 0.0 0.0 58 KB

A GitHub Action for mirroring your repository to a different remote repository

License: Apache License 2.0

Shell 82.50% Dockerfile 17.50%

mirror-action's Introduction

mirror-action

A GitHub Action for mirroring your commits to a different remote repository

This project is mirrored on GitLab

Example workflows

Mirror a repository with username/password over HTTPS

For example, this project uses the following workflow to mirror from GitHub to GitLab

on: [push]
  ...
      steps:
        - uses: actions/checkout@v3
          with:
            fetch-depth: 0
        - uses: yesolutions/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"

Mirror a repository using SSH

Requires version 0.4.0+

Pretty much the same, but using GIT_SSH_PRIVATE_KEY and GIT_SSH_KNOWN_HOSTS

      steps:
        - uses: actions/checkout@v3
          with:
            fetch-depth: 0
        - uses: yesolutions/mirror-action@master
          with:
            REMOTE: 'ssh://[email protected]/spyoungtech/mirror-action.git'
            GIT_SSH_PRIVATE_KEY: ${{ secrets.GIT_SSH_PRIVATE_KEY }}
            GIT_SSH_KNOWN_HOSTS: ${{ secrets.GIT_SSH_KNOWN_HOSTS }}

GIT_SSH_KNOWN_HOSTS is expected to be the contents of a known_hosts file.

Be sure you set the secrets in your repo secrets settings!

NOTE: if you prefer to skip hosts verification instead of providing a known_hosts file, you can do so by using the GIT_SSH_NO_VERIFY_HOST input option. e.g.

      steps:
        - uses: actions/checkout@v3
          with:
            fetch-depth: 0
        - uses: yesolutions/mirror-action@master
          with:
            REMOTE: [email protected]/spyoungtech/mirror-action.git
            GIT_SSH_PRIVATE_KEY: ${{ secrets.GIT_SSH_PRIVATE_KEY }}
            GIT_SSH_NO_VERIFY_HOST: "true"

WARNING: this setting is a compromise in security. Using known hosts is recommended.

mirror-action's People

Contributors

kanglin avatar osoderholm avatar perkoren avatar pre-commit-ci[bot] avatar skarzi avatar spyoungtech avatar

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.