forked from integrations/terraform-provider-github
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Organization Webhook Example | ||
|
||
This displays retrieval of a GitHub organization webhook. | ||
|
||
This example will look up a GitHub organization webhook. See https://www.terraform.io/docs/providers/github/index.html for details on configuring [`providers.tf`](./providers.tf) accordingly. | ||
|
||
Alternatively, you may use variables passed via command line: | ||
|
||
```console | ||
export GITHUB_ORG= | ||
export GITHUB_TOKEN= | ||
``` | ||
|
||
```console | ||
terraform apply \ | ||
-var "organization=${GITHUB_ORG}" \ | ||
-var "github_token=${GITHUB_TOKEN}" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
resource "github_organization_webhook" "example_com" { | ||
configuration { | ||
url = "https://example.com/" | ||
content_type = "form" | ||
insecure_ssl = false | ||
} | ||
|
||
active = false | ||
|
||
events = ["issues"] | ||
} | ||
|
||
data "github_organization_webhooks" "all" {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
output "resource_github_organization_webhooks" { | ||
description = "The content type of the webhook" | ||
value = data.github_organization_webhooks.all | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
provider "github" { | ||
owner = var.organization | ||
token = var.github_token | ||
} | ||
|
||
terraform { | ||
required_providers { | ||
github = { | ||
source = "integrations/github" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
variable "organization" { | ||
description = "GitHub organization used to configure the provider" | ||
type = string | ||
} | ||
|
||
variable "github_token" { | ||
description = "GitHub access token used to configure the provider" | ||
type = string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Repository Webhook Example | ||
|
||
This displays retrieval of a GitHub repository webhook. | ||
|
||
This example will look up a GitHub repository webhook. See https://www.terraform.io/docs/providers/github/index.html for details on configuring [`providers.tf`](./providers.tf) accordingly. | ||
|
||
Alternatively, you may use variables passed via command line: | ||
|
||
```console | ||
export GITHUB_ORG= | ||
export GITHUB_TOKEN= | ||
export GITHUB_REPOSITORY= | ||
``` | ||
|
||
```console | ||
terraform apply \ | ||
-var "repository=${GITHUB_ORG}" \ | ||
-var "github_token=${GITHUB_TOKEN}" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
data "github_repository" "repo" { | ||
full_name = var.repository | ||
} | ||
|
||
resource "github_repository_webhook" "example_com" { | ||
repository = data.github_repository.repo.name | ||
|
||
configuration { | ||
url = "https://google.de/" | ||
content_type = "form" | ||
insecure_ssl = false | ||
} | ||
|
||
active = false | ||
|
||
events = ["issues"] | ||
|
||
} | ||
|
||
data "github_repository_webhooks" "all" { | ||
repository = data.github_repository.repo.name | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
output "resource_github_repository_webhooks" { | ||
description = "The content type of the webhooks" | ||
value = data.github_repository_webhooks.all | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
provider "github" { | ||
owner = var.organization | ||
token = var.github_token | ||
} | ||
|
||
terraform { | ||
required_providers { | ||
github = { | ||
source = "integrations/github" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
variable "organization" { | ||
description = "GitHub organization used to configure the provider" | ||
type = string | ||
} | ||
|
||
variable "github_token" { | ||
description = "GitHub access token used to configure the provider" | ||
type = string | ||
} | ||
|
||
variable "repository" { | ||
description = "GitHub repository used to configure the provider" | ||
type = string | ||
} |