Skip to content

Instantly share code, notes, and snippets.

@john012343210
Last active February 24, 2021 01:46
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save john012343210/6e606eb4f9c9bb2c1fbd6f00dcab24a4 to your computer and use it in GitHub Desktop.
Save john012343210/6e606eb4f9c9bb2c1fbd6f00dcab24a4 to your computer and use it in GitHub Desktop.
sync github to gitlab
  • proposal:
    • doesnt use gitlab pull mirror or github action to push
      • approach 0: a script in a server periodically pulling the change from all github repo to local from github and pushing to gitlab.
        • problems
          • required the server to be always running, and it has to contains all the github repos in drive.
    • use gitlab pull mirror:
    • use github action to act like a push mirror:
      • approach 2: a server constantly running to check if any GitHub repo doesnt has a counter part in Gitlab, if found, create a GitLab repo, add a gitHub action by api to that GitHub repository that is set to push the change to the newly created gitlab repo.
        • advantage:
          • all old repository and new repository in Github will be linked to gitlab.
        • problems:
          • since the server has to add a github action, it means that it has write permission to all github repository, if the server is hacked, hacker could add any commit or change commit history.
          • the github action will have write permission to counterpart gitlab repository
            • possibly by ssh key set in github secret
              • so the secret has to be added by api also, but seems such api doesnt exist yet github secret api
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment