Repository Webhook
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());
}
}
Content copied to clipboard
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
Content copied to clipboard
If secret is populated in the webhook's configuration, the value will be imported as "********".
Properties
Link copied to clipboard
Configuration block for the webhook. Detailed below.
Link copied to clipboard
A list of events which should trigger the webhook. See a list of available events.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
The repository of the webhook.