diff --git a/README.md b/README.md index f136b21..46ea423 100644 --- a/README.md +++ b/README.md @@ -120,28 +120,43 @@ Available targets: lint Lint terraform code ``` +## Requirements + +| Name | Version | +|------|---------| +| terraform | ~> 0.12.0 | +| github | ~> 2.8.0 | +| github | ~> 2.2 | +| local | ~> 1.2 | + +## Providers + +| Name | Version | +|------|---------| +| github | ~> 2.8.0 ~> 2.2 | + ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|:----:|:-----:|:-----:| -| active | Indicate of the webhook should receive events | bool | `true` | no | -| enabled | Whether or not to enable this module | bool | `true` | no | -| events | A list of events which should trigger the webhook. | list(string) | `` | no | -| github_anonymous | Github Anonymous API (if `true`, token must not be set as GITHUB_TOKEN or `github_token`) | bool | `false` | no | -| github_base_url | GitHub target API endpoint | string | `https://api.github.com/` | no | -| github_organization | GitHub organization to use when creating webhooks | string | - | yes | -| github_repositories | List of repository names which should be associated with the webhook | list(string) | `` | no | -| github_token | GitHub token used for API access. If not provided, can be sourced from the `GITHUB_TOKEN` environment variable | string | `` | no | -| webhook_content_type | Webhook Content Type (e.g. `json`) | string | `json` | no | -| webhook_insecure_ssl | Webhook Insecure SSL (e.g. trust self-signed certificates) | bool | `false` | no | -| webhook_secret | Webhook secret | string | `` | no | -| webhook_url | Webhook URL | string | - | yes | +|------|-------------|------|---------|:--------:| +| active | Indicate of the webhook should receive events | `bool` | `true` | no | +| enabled | Whether or not to enable this module | `bool` | `true` | no | +| events | A list of events which should trigger the webhook. | `list(string)` |
[
"issue_comment",
"pull_request",
"pull_request_review",
"pull_request_review_comment"
]
| no | +| github\_anonymous | Github Anonymous API (if `true`, token must not be set as GITHUB\_TOKEN or `github_token`) | `bool` | `false` | no | +| github\_base\_url | GitHub target API endpoint | `string` | `"https://api.github.com/"` | no | +| github\_organization | GitHub organization to use when creating webhooks | `string` | n/a | yes | +| github\_repositories | List of repository names which should be associated with the webhook | `list(string)` | `[]` | no | +| github\_token | GitHub token used for API access. If not provided, can be sourced from the `GITHUB_TOKEN` environment variable | `string` | `""` | no | +| webhook\_content\_type | Webhook Content Type (e.g. `json`) | `string` | `"json"` | no | +| webhook\_insecure\_ssl | Webhook Insecure SSL (e.g. trust self-signed certificates) | `bool` | `false` | no | +| webhook\_secret | Webhook secret | `string` | `""` | no | +| webhook\_url | Webhook URL | `string` | n/a | yes | ## Outputs | Name | Description | |------|-------------| -| webhook_url | Webhook URL | +| webhook\_url | Webhook URL | diff --git a/docs/terraform.md b/docs/terraform.md index cd2e869..1565992 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -1,23 +1,38 @@ +## Requirements + +| Name | Version | +|------|---------| +| terraform | ~> 0.12.0 | +| github | ~> 2.8.0 | +| github | ~> 2.2 | +| local | ~> 1.2 | + +## Providers + +| Name | Version | +|------|---------| +| github | ~> 2.8.0 ~> 2.2 | + ## Inputs | Name | Description | Type | Default | Required | -|------|-------------|:----:|:-----:|:-----:| -| active | Indicate of the webhook should receive events | bool | `true` | no | -| enabled | Whether or not to enable this module | bool | `true` | no | -| events | A list of events which should trigger the webhook. | list(string) | `` | no | -| github_anonymous | Github Anonymous API (if `true`, token must not be set as GITHUB_TOKEN or `github_token`) | bool | `false` | no | -| github_base_url | GitHub target API endpoint | string | `https://api.github.com/` | no | -| github_organization | GitHub organization to use when creating webhooks | string | - | yes | -| github_repositories | List of repository names which should be associated with the webhook | list(string) | `` | no | -| github_token | GitHub token used for API access. If not provided, can be sourced from the `GITHUB_TOKEN` environment variable | string | `` | no | -| webhook_content_type | Webhook Content Type (e.g. `json`) | string | `json` | no | -| webhook_insecure_ssl | Webhook Insecure SSL (e.g. trust self-signed certificates) | bool | `false` | no | -| webhook_secret | Webhook secret | string | `` | no | -| webhook_url | Webhook URL | string | - | yes | +|------|-------------|------|---------|:--------:| +| active | Indicate of the webhook should receive events | `bool` | `true` | no | +| enabled | Whether or not to enable this module | `bool` | `true` | no | +| events | A list of events which should trigger the webhook. | `list(string)` |
[
"issue_comment",
"pull_request",
"pull_request_review",
"pull_request_review_comment"
]
| no | +| github\_anonymous | Github Anonymous API (if `true`, token must not be set as GITHUB\_TOKEN or `github_token`) | `bool` | `false` | no | +| github\_base\_url | GitHub target API endpoint | `string` | `"https://api.github.com/"` | no | +| github\_organization | GitHub organization to use when creating webhooks | `string` | n/a | yes | +| github\_repositories | List of repository names which should be associated with the webhook | `list(string)` | `[]` | no | +| github\_token | GitHub token used for API access. If not provided, can be sourced from the `GITHUB_TOKEN` environment variable | `string` | `""` | no | +| webhook\_content\_type | Webhook Content Type (e.g. `json`) | `string` | `"json"` | no | +| webhook\_insecure\_ssl | Webhook Insecure SSL (e.g. trust self-signed certificates) | `bool` | `false` | no | +| webhook\_secret | Webhook secret | `string` | `""` | no | +| webhook\_url | Webhook URL | `string` | n/a | yes | ## Outputs | Name | Description | |------|-------------| -| webhook_url | Webhook URL | +| webhook\_url | Webhook URL | diff --git a/main.tf b/main.tf index 4e1061d..0410ac4 100644 --- a/main.tf +++ b/main.tf @@ -1,3 +1,9 @@ +terraform { + required_providers { + github = "~> 2.8.0" + } +} + provider "github" { token = var.github_token != "" ? var.github_token : null organization = var.github_organization