debian-mirror-gitlab/doc/user/project/integrations/github.md

56 lines
2.5 KiB
Markdown
Raw Normal View History

2020-10-24 23:57:45 +05:30
---
stage: Create
group: Ecosystem
2021-02-22 17:27:13 +05:30
info: 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
2020-10-24 23:57:45 +05:30
---
2019-09-30 21:07:59 +05:30
# GitHub project integration **(PREMIUM)**
2019-07-31 22:56:46 +05:30
2020-06-23 00:09:42 +05:30
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/3836) in GitLab Premium 10.6.
2019-07-31 22:56:46 +05:30
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](../import/github.md#mirroring-and-pipeline-status-sharing)
and is automatically configured on [GitHub import](../../../integration/github.md).
![Pipeline status update on GitHub](img/github_status_check_pipeline_update.png)
## Configuration
### Complete these steps on GitHub
2021-04-17 20:07:23 +05:30
This integration requires a [GitHub API token](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token)
2019-07-31 22:56:46 +05:30
with `repo:status` access granted:
2019-09-30 21:07:59 +05:30
1. Go to your "Personal access tokens" page at <https://github.com/settings/tokens>
2019-07-31 22:56:46 +05:30
1. Click "Generate New Token"
1. Ensure that `repo:status` is checked and click "Generate token"
1. Copy the generated token to use on GitLab
### Complete these steps on GitLab
1. Navigate to the project you want to configure.
2020-04-22 19:07:51 +05:30
1. Navigate to the [Integrations page](overview.md#accessing-integrations)
2019-07-31 22:56:46 +05:30
1. Click "GitHub".
2020-04-22 19:07:51 +05:30
1. Ensure that the **Active** toggle is enabled.
2019-07-31 22:56:46 +05:30
1. Paste the token you've generated on GitHub
1. Enter the path to your project on GitHub, such as `https://github.com/username/repository`
2019-12-04 20:38:33 +05:30
1. Optionally uncheck **Static status check names** checkbox to disable static status check names.
2019-07-31 22:56:46 +05:30
1. Save or optionally click "Test Settings".
2020-01-01 13:55:28 +05:30
Once the integration is configured, see [Pipelines for external pull requests](../../../ci/ci_cd_for_external_repos/#pipelines-for-external-pull-requests)
to configure pipelines to run for open pull requests.
2019-07-31 22:56:46 +05:30
#### Static / dynamic status check names
2019-12-04 20:38:33 +05:30
> - Introduced in GitLab 11.5: using static status check names as opt-in option.
2020-06-23 00:09:42 +05:30
> - [In GitLab 12.4](https://gitlab.com/gitlab-org/gitlab/-/issues/9931), static status check names is default behavior for new projects.
2019-07-31 22:56:46 +05:30
This makes it possible to mark these status checks as _Required_ on GitHub.
2019-12-04 20:38:33 +05:30
With **Static status check names** enabled on the integration page, your
2021-02-22 17:27:13 +05:30
GitLab instance host name is appended to a status check name,
whereas in case of dynamic status check names, a branch name is appended.
2019-07-31 22:56:46 +05:30
![Configure GitHub Project Integration](img/github_configuration.png)