RepositoryWebhookArgs

data class RepositoryWebhookArgs(val active: Output<Boolean>? = null, val configuration: Output<RepositoryWebhookConfigurationArgs>? = null, val events: Output<List<String>>? = null, val repository: Output<String>? = null) : ConvertibleToJava<RepositoryWebhookArgs>

This resource allows you to create and manage webhooks for repositories within your GitHub organization or personal account.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const repo = new github.Repository("repo", {
name: "foo",
description: "Terraform acceptance tests",
homepageUrl: "http://example.com/",
visibility: "public",
});
const foo = new github.RepositoryWebhook("foo", {
repository: repo.name,
configuration: {
url: "https://google.de/",
contentType: "form",
insecureSsl: false,
},
active: false,
events: ["issues"],
});
import pulumi
import pulumi_github as github
repo = github.Repository("repo",
name="foo",
description="Terraform acceptance tests",
homepage_url="http://example.com/",
visibility="public")
foo = github.RepositoryWebhook("foo",
repository=repo.name,
configuration={
"url": "https://google.de/",
"content_type": "form",
"insecure_ssl": False,
},
active=False,
events=["issues"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var repo = new Github.Repository("repo", new()
{
Name = "foo",
Description = "Terraform acceptance tests",
HomepageUrl = "http://example.com/",
Visibility = "public",
});
var foo = new Github.RepositoryWebhook("foo", new()
{
Repository = repo.Name,
Configuration = new Github.Inputs.RepositoryWebhookConfigurationArgs
{
Url = "https://google.de/",
ContentType = "form",
InsecureSsl = false,
},
Active = false,
Events = new[]
{
"issues",
},
});
});
package main
import (
"github.com/pulumi/pulumi-github/sdk/v6/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
repo, err := github.NewRepository(ctx, "repo", &github.RepositoryArgs{
Name: pulumi.String("foo"),
Description: pulumi.String("Terraform acceptance tests"),
HomepageUrl: pulumi.String("http://example.com/"),
Visibility: pulumi.String("public"),
})
if err != nil {
return err
}
_, err = github.NewRepositoryWebhook(ctx, "foo", &github.RepositoryWebhookArgs{
Repository: repo.Name,
Configuration: &github.RepositoryWebhookConfigurationArgs{
Url: pulumi.String("https://google.de/"),
ContentType: pulumi.String("form"),
InsecureSsl: pulumi.Bool(false),
},
Active: pulumi.Bool(false),
Events: pulumi.StringArray{
pulumi.String("issues"),
},
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.Repository;
import com.pulumi.github.RepositoryArgs;
import com.pulumi.github.RepositoryWebhook;
import com.pulumi.github.RepositoryWebhookArgs;
import com.pulumi.github.inputs.RepositoryWebhookConfigurationArgs;
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 repo = new Repository("repo", RepositoryArgs.builder()
.name("foo")
.description("Terraform acceptance tests")
.homepageUrl("http://example.com/")
.visibility("public")
.build());
var foo = new RepositoryWebhook("foo", RepositoryWebhookArgs.builder()
.repository(repo.name())
.configuration(RepositoryWebhookConfigurationArgs.builder()
.url("https://google.de/")
.contentType("form")
.insecureSsl(false)
.build())
.active(false)
.events("issues")
.build());
}
}
resources:
repo:
type: github:Repository
properties:
name: foo
description: Terraform acceptance tests
homepageUrl: http://example.com/
visibility: public
foo:
type: github:RepositoryWebhook
properties:
repository: ${repo.name}
configuration:
url: https://google.de/
contentType: form
insecureSsl: false
active: false
events:
- issues

Import

Repository webhooks can be imported using the name of the repository, combined with the id of the webhook, separated by a / character. The id of the webhook can be found in the URL of the webhook. For example: "https://github.com/foo-org/foo-repo/settings/hooks/14711452". Importing uses the name of the repository, as well as the ID of the webhook, e.g.

$ pulumi import github:index/repositoryWebhook:RepositoryWebhook terraform terraform/11235813

If secret is populated in the webhook's configuration, the value will be imported as "********".

Constructors

Link copied to clipboard
constructor(active: Output<Boolean>? = null, configuration: Output<RepositoryWebhookConfigurationArgs>? = null, events: Output<List<String>>? = null, repository: Output<String>? = null)

Properties

Link copied to clipboard
val active: Output<Boolean>? = null

Indicate if the webhook should receive events. Defaults to true.

Link copied to clipboard

Configuration block for the webhook. Detailed below.

Link copied to clipboard
val events: Output<List<String>>? = null

A list of events which should trigger the webhook. See a list of available events.

Link copied to clipboard
val repository: Output<String>? = null

The repository of the webhook.

Functions

Link copied to clipboard
open override fun toJava(): RepositoryWebhookArgs