GithubHelp home page GithubHelp logo

cyberflamego / github-sync Goto Github PK

View Code? Open in Web Editor NEW

This project forked from repo-sync/github-sync

0.0 2.0 0.0 62 KB

⤵️ A GitHub Action for syncing current repository with remote

Home Page: https://github.com/marketplace/actions/github-repo-sync

License: MIT License

Shell 72.47% Dockerfile 27.53%

github-sync's Introduction

GitHub Sync

All Contributors

A GitHub Action for syncing the current repository using force push.

Features

  • Sync branches between two GitHub repositories
  • Sync branches from a remote repository
  • GitHub action can be triggered on a timer or on push
  • To push to a remote repository, please checkout git-sync
  • Support syncing tags.

Usage

Create a personal access token and add to repository's secret as PAT

GitHub Actions

# File: .github/workflows/repo-sync.yml

on:
  schedule:
  - cron:  "*/15 * * * *"
  workflow_dispatch:

jobs:
  repo-sync:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
      with:
        persist-credentials: false
    - name: repo-sync
      uses: repo-sync/github-sync@v2
      with:
        source_repo: ""
        source_branch: ""
        destination_branch: ""
        github_token: ${{ secrets.PAT }}

If source_repo is private or with another provider, either (1) use an authenticated HTTPS repo clone url like https://${access_token}@github.com/owner/repository.git or (2) set a SSH_PRIVATE_KEY secret environment variable and use the SSH clone url

Advanced Usage: Sync all branches

  1. Make a backup
  2. Create a new branch in your repo (destination repo), it should not share the name with any branch in source repo
  3. Make the new branch the default branch under repo settings
  4. Use * for both source_branch and destination_branch
  5. Optionally, you can force sync all tags:
    with:
      sync_tags: "true"
    

This will force sync ALL branches to match source repo. Branches that are created only in the destination repo will not be affected but all the other branches will be hard reset to match source repo. ⚠️ This does mean if upstream ever creates a branch that shares the name, your changes will be gone.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Wei He

💻 📖 🎨 🤔

Zeke Sikelianos

📖 🤔

Alex Page

🐛

xtqqczze

💻 📖

Kay Harrison-Sims

🐛

Gibby

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

github-sync's People

Contributors

allcontributors[bot] avatar gibby avatar notorious-gay avatar wei avatar xtqqczze avatar zeke avatar

Watchers

 avatar  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.