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

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()
.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());
}
}

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