Skip to content

Commit 04c2aab

Browse files
committed
Add docs
1 parent 488cd4c commit 04c2aab

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
layout: "gitlab"
3+
page_title: "GitLab: gitlab_service_github"
4+
sidebar_current: "docs-gitlab-resource-service_github"
5+
description: |-
6+
Manage GitHub integration that updates pipeline statuses on a GitHub repo's pull requests.
7+
---
8+
9+
# gitlab\_service\_github
10+
11+
**NOTE**: requires either EE (self-hosted) or Silver and above (GitLab.com).
12+
13+
This resource manages a [GitHub integration](https://docs.gitlab.com/ee/user/project/integrations/github.html) that updates pipeline statuses on a GitHub repo's pull requests.
14+
15+
## Example Usage
16+
17+
```hcl
18+
resource "gitlab_project" "awesome_project" {
19+
name = "awesome_project"
20+
description = "My awesome project."
21+
visibility_level = "public"
22+
}
23+
24+
resource "gitlab_service_github" "github" {
25+
project = "${gitlab_project.awesome_project.id}"
26+
token = "REDACTED"
27+
repository_url = "https://github.com/terraform-providers/terraform-provider-gitlab"
28+
}
29+
```
30+
31+
## Argument Reference
32+
33+
The following arguments are supported:
34+
35+
* `project` - (Required) ID of the project you want to activate integration on.
36+
37+
* `repository_url` - (Required) The URL of the GitHub repo to integrate with, e,g, https://github.com/terraform-providers/terraform-provider-gitlab.
38+
39+
* `token` - (Required) A GitHub personal access token with at least `repo:status` scope.
40+
41+
* `static_context` - (Optional) Append instance name instead of branch to the status. Must enable to set a GitLab status check as _required_ in GitHub. See [Static / dynamic status check names] to learn more.
42+
43+
## Importing GitHub service
44+
45+
You can import a service_github state using `terraform import <resource> <project_id>`:
46+
47+
```bash
48+
$ terraform import gitlab_service_github.github 1
49+
```

0 commit comments

Comments
 (0)