gitlab-org--gitlab-foss/doc/user/project/integrations/github.md

2.6 KiB

stage group info
Create Ecosystem To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments

GitHub project integration (PREMIUM)

Introduced in GitLab Premium 10.6.

GitLab provides an integration for updating the pipeline statuses on GitHub. This is especially useful if using GitLab for CI/CD only.

This project integration is separate from the instance wide GitHub integration and is automatically configured on GitHub import.

Pipeline status update on GitHub

Configuration

Complete these steps on GitHub

This integration requires a GitHub API token with repo:status access granted:

  1. Go to your "Personal access tokens" page at https://github.com/settings/tokens
  2. Click "Generate New Token"
  3. Ensure that repo:status is checked and click "Generate token"
  4. Copy the generated token to use on GitLab

Complete these steps on GitLab

  1. Navigate to the project you want to configure.
  2. Navigate to the Integrations page
  3. Click "GitHub".
  4. Ensure that the Active toggle is enabled.
  5. Paste the token you've generated on GitHub
  6. Enter the path to your project on GitHub, such as https://github.com/username/repository
  7. Optionally uncheck Static status check names checkbox to disable static status check names.
  8. Save or optionally click "Test Settings".

Once the integration is configured, see Pipelines for external pull requests to configure pipelines to run for open pull requests.

Static / dynamic status check names

  • Introduced in GitLab 11.5: using static status check names as opt-in option.
  • In GitLab 12.4, static status check names is default behavior for new projects.

This makes it possible to mark these status checks as Required on GitHub. With Static status check names enabled on the integration page, your GitLab instance host name is appended to a status check name, whereas in case of dynamic status check names, a branch name is appended.

Configure GitHub Project Integration