Code Monkey home page Code Monkey logo

repository-sync-hub's Introduction

Repository Sync Hub

GitHub release (latest SemVer) GitHub

A GitHub Actions for sync current repository to other hub.


Features

  • Sync branches and tags to other repository (GitHub, GitLab, Gitee, etc.)
  • Target repository support SSH and HTTP URL
  • Automatic delete branches and tags that is deleted
  • Retry on network errors
  • Can triggered on PUSH and DELETE event
  • Can triggered on a timer (SCHEDULE)

Usage

Be sure to run the actions/checkout in a step before this action.

SSH URL

# File .github/workflows/sync-ssh.yml

steps:
  -
    name: Checkout
    uses: actions/checkout@v3
    with:
      # Must be specified as 0, otherwise git does not allow push because of shallow updates.
      fetch-depth: 0
  -
    name: Sync
    uses: ttionya/Repository-Sync-Hub@v1
    with:
      # Sync to target repository full clone URL.
      target_repository: '[email protected]:ttionya/Repository-Sync-Hub-Test.git'
      # SSH key used to authenticate with git operations.
      ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}

HTTP URL

# File .github/workflows/sync-http.yml

steps:
  -
    name: Checkout
    uses: actions/checkout@v3
    with:
      # Must be specified as 0, otherwise git does not allow push because of shallow updates.
      fetch-depth: 0
      # Be sure use your own access token when you want to sync to GitHub repository,
      # only HTTP URL need this.
      token: ${{ secrets.HTTP_ACCESS_TOKEN }}
  -
    name: Sync
    uses: ttionya/Repository-Sync-Hub@v1
    with:
      # Sync to target repository full clone URL.
      target_repository: 'https://github.com/ttionya/Repository-Sync-Hub-Test.git'
      # Login name used to authenticate with git operations.
      http_access_name: 'ttionya'
      # Personal Access Token (PAT) used to authenticate with git operations.
      http_access_token: ${{ secrets.HTTP_ACCESS_TOKEN }}

Note: Access token needs workflow access, it will automatically check the full access to the repository.

You can see sample workflows for more usages.


About Dependabot

Dependabot triggered Actions can't access secrets now, you can view details here.


Thanks

Inspired by the following actions which may be more suitable for your workflow.


License

MIT

repository-sync-hub's People

Contributors

ttionya avatar

Watchers

 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.