github.md 2.71 KB
Newer Older
1
---
Kati Paizee's avatar
Kati Paizee committed
2 3
stage: Ecosystem
group: Integrations
4
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
5 6
---

7
# GitHub project integration **(PREMIUM)**
8

9 10
You can update GitHub with pipeline status updates from GitLab.
This integration can help you if you use GitLab for CI/CD.
11 12 13

![Pipeline status update on GitHub](img/github_status_check_pipeline_update.png)

14 15 16 17
This project integration is separate from the [instance-wide GitHub integration](../import/github.md#mirror-a-repository-and-share-pipeline-status)
and is automatically configured when you import a [GitHub project](../../../integration/github.md).

## Configure the integration
18

19
This integration requires a [GitHub API token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
20 21 22
with `repo:status` access granted.

Complete these steps on GitHub:
23

24 25 26
1. Go to your **Personal access tokens** page at <https://github.com/settings/tokens>.
1. Select **Generate new token**.
1. Under **Note**, enter a name for the new token.
27
1. Ensure `repo:status` is selected and select **Generate token**.
28
1. Copy the generated token to use in GitLab.
29

30
Complete these steps in GitLab:
31

32 33
1. On the top bar, select **Menu > Projects** and find your project.
1. On the left sidebar, select **Settings > Integrations**.
34
1. Select **GitHub**.
35 36 37 38 39 40
1. Ensure the **Active** checkbox is selected.
1. In **Token**, paste the token you generated on GitHub.
1. In **Repository URL**, enter the path to your project on GitHub, such as `https://github.com/username/repository`.
1. Optional. To disable [static status check names](#static-or-dynamic-status-check-names), clear the **Enable static status check names** checkbox.
1. Optional. Select **Test settings**.
1. Select **Save changes**.
41

42
After configuring the integration, see [Pipelines for external pull requests](../../../ci/ci_cd_for_external_repos/#pipelines-for-external-pull-requests)
43 44
to configure pipelines to run for open pull requests.

45
### Static or dynamic status check names
46

47
> [Changed](https://gitlab.com/gitlab-org/gitlab/-/issues/9931) in GitLab 12.4 to make static status check names the default behavior for new projects.
48 49 50 51 52

A status check name can be static or dynamic:

- **Static**: The hostname of your
  GitLab instance is appended to the status check name.
53

54 55
- **Dynamic**: The branch name is appended
  to the status check name.
56

57 58
The **Enable static status check names** option enables you to configure
required status checks in GitHub, which need a consistent (static) name to work correctly.
59

60 61
If you [disable this option](#configure-the-integration),
GitLab uses dynamic status check names instead.