Skip to content

Make GitLab CI/CD work with an external repository (GitHub, Bitbucket)

Description

Several customers and prospects are interested in having a full CI/CD experience using GitLab CI/CD, but with the code repository hosted on external services, like GitHub or BitBucket.

GitLab CI/CD relies heavily on having the code in a local repo, and cannot be linked to external ones. One possible solution is to cache the external project on GitLab, and run pipelines from here, with status updated back to GitHub/BitBucket via their Status API. It is also useful to make the setup easy for users and provide a good user experience when using a GitLab just for CI/CD.

The first external service to be supported is GitHub.

Minimal viable changes
Second step
Third step
Improvements
  1. Pipelines list as project overview: https://gitlab.com/gitlab-org/gitlab-ee/issues/3840
  2. Global pipelines list as user homepage: https://gitlab.com/gitlab-org/gitlab-ee/issues/3841
Future considerations
  1. Send environment deployment status to GitHub: https://gitlab.com/gitlab-org/gitlab-ee/issues/3842
  2. Add GitLab CI/CD to GitHub Marketplace
  3. Configure GitLab CI/CD via project setting instead of .gitlab-ci.yml
  4. Disable Repository read/write while still enabling Pipelines
  5. Support GitHub.com and one or more GHE instances at the same time: https://gitlab.com/gitlab-org/gitlab-ee/issues/5354
  6. Connect to GitHub Enterprise at group level: #5355
Edited by James Ramsay (ex-GitLab)