Skip to content

An action that allows a remote repository to be mirrored to GitHub

License

Notifications You must be signed in to change notification settings

amadigan/github-mirror

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Mirror

Github Mirror is a GitHub Action that keeps a GitHub repository up to date as a mirror of an external repository. It will synchronize all branches and commits from the specified repository, it will not copy non-Git data such as Pull Requests.

Setup

To create a mirror, start by creating a repository locally and creating a branch to hold the workflow file. The branch should be named such that it will not conflict with a branch name in the source repository.

$ git init mirror
$ git -C mirror checkout -b __mirror
$ mkdir -p mirror/.github/workflows

Create a file like the one below in your repository. Replace TARGET_REPO_HERE with the URL of a the git repository to mirror.

.github/workflows/mirror.yml

name: 'mirror'
on:
  push:
    branches:
        - __mirror
  schedule:
    - cron: '* 3 * * *'
  workflow_dispatch:

jobs:
  mirror:
    runs-on: ubuntu-latest
    name: mirror
    steps:
      - name: mirror
        id: mirror
        uses: bridgelightcloud/github-mirror@main
        with:
          origin: 'TARGET_REPO_HERE'
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Commit the workflow file, then create a repository on GitHub and push the branch. The workflow will start immediately and copy the source repository.

License

The code is trivial, as such this repository is licensed under the Creative Commons CC-0 license.

About

An action that allows a remote repository to be mirrored to GitHub

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published