Service Github
The gitlab.ServiceGithub
resource allows to manage the lifecycle of a project integration with GitHub.
This resource requires a GitLab Enterprise instance. This resource is deprecated. use
gitlab.IntegrationGithub
instead! Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const awesomeProject = new gitlab.Project("awesomeProject", {
description: "My awesome project.",
visibilityLevel: "public",
});
const github = new gitlab.ServiceGithub("github", {
project: awesomeProject.id,
token: "REDACTED",
repositoryUrl: "https://github.com/gitlabhq/terraform-provider-gitlab",
});
Content copied to clipboard
import pulumi
import pulumi_gitlab as gitlab
awesome_project = gitlab.Project("awesomeProject",
description="My awesome project.",
visibility_level="public")
github = gitlab.ServiceGithub("github",
project=awesome_project.id,
token="REDACTED",
repository_url="https://github.com/gitlabhq/terraform-provider-gitlab")
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var awesomeProject = new GitLab.Project("awesomeProject", new()
{
Description = "My awesome project.",
VisibilityLevel = "public",
});
var github = new GitLab.ServiceGithub("github", new()
{
Project = awesomeProject.Id,
Token = "REDACTED",
RepositoryUrl = "https://github.com/gitlabhq/terraform-provider-gitlab",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v6/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
awesomeProject, err := gitlab.NewProject(ctx, "awesomeProject", &gitlab.ProjectArgs{
Description: pulumi.String("My awesome project."),
VisibilityLevel: pulumi.String("public"),
})
if err != nil {
return err
}
_, err = gitlab.NewServiceGithub(ctx, "github", &gitlab.ServiceGithubArgs{
Project: awesomeProject.ID(),
Token: pulumi.String("REDACTED"),
RepositoryUrl: pulumi.String("https://github.com/gitlabhq/terraform-provider-gitlab"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.Project;
import com.pulumi.gitlab.ProjectArgs;
import com.pulumi.gitlab.ServiceGithub;
import com.pulumi.gitlab.ServiceGithubArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var awesomeProject = new Project("awesomeProject", ProjectArgs.builder()
.description("My awesome project.")
.visibilityLevel("public")
.build());
var github = new ServiceGithub("github", ServiceGithubArgs.builder()
.project(awesomeProject.id())
.token("REDACTED")
.repositoryUrl("https://github.com/gitlabhq/terraform-provider-gitlab")
.build());
}
}
Content copied to clipboard
resources:
awesomeProject:
type: gitlab:Project
properties:
description: My awesome project.
visibilityLevel: public
github:
type: gitlab:ServiceGithub
properties:
project: ${awesomeProject.id}
token: REDACTED
repositoryUrl: https://github.com/gitlabhq/terraform-provider-gitlab
Content copied to clipboard
Import
$ pulumi import gitlab:index/serviceGithub:ServiceGithub You can import a gitlab_service_github state using `<resource> <project_id>`:
Content copied to clipboard
$ pulumi import gitlab:index/serviceGithub:ServiceGithub github 1
Content copied to clipboard
Properties
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
The URL of the GitHub repo to integrate with, e,g, https://github.com/gitlabhq/terraform-provider-gitlab.
Link copied to clipboard
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.