Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
793 views
in Technique[技术] by (71.8m points)

continuous integration - Access GitHub within GitLab over deployed key from GitHub

I have one question since a while. The question is, is it possible to access GitHub within Gitlab over an deployed key(ssh key). Also an other solution could be possible, my main goal is, if an push is done into Github, Gitlab will register this and executes automation. What I try to prevent is, that GitLab has access to all repos within GitHub. GitHub OAuth and token doesn't work because it gives access to all my repos within Github.

Best Regards

question from:https://stackoverflow.com/questions/65885988/access-github-within-gitlab-over-deployed-key-from-github

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

1 Answer

0 votes
by (71.8m points)

You can do this via the Repository Mirroring option in Gitlab. This allows you to mirror a repository from Github, Bitbucket, etc to Gitlab, or from Gitlab to another service.

To pull into Gitlab, first create a new project in Gitlab then go to Settings, Repository, Mirroring Repositories and set it up however you require. The full details are available in their documentation: https://docs.gitlab.com/ee/user/project/repository/repository_mirroring.html#pulling-from-a-remote-repository

Note that for now, this is a paid feature so you must have starter/core or above.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to JiKe DevOps Community for programmer and developer-Open, Learning and Share
...