Skip to content

Commit 85b4ee0

Browse files
authored
Make github_token optional (#9)
* Make `github_token` optional * Make `github_token` optional
1 parent 893fcb7 commit 85b4ee0

File tree

5 files changed

+28
-26
lines changed

5 files changed

+28
-26
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
[![Build Status](https://travis-ci.org/cloudposse/terraform-github-repository-webhooks.svg?branch=master)](https://travis-ci.org/cloudposse/terraform-github-repository-webhooks) [![Latest Release](https://img.shields.io/github/release/cloudposse/terraform-github-repository-webhooks.svg)](https://github.com/cloudposse/terraform-github-repository-webhooks/releases/latest) [![Slack Community](https://slack.cloudposse.com/badge.svg)](https://slack.cloudposse.com)
99

1010

11-
Terraform module to provision webhooks on a set of GitHub repositories.
11+
Terraform module to provision webhooks on a set of GitHub repositories.
1212
This is useful if you need to register a webhook en masse across dozens of repositories.
1313

1414

@@ -54,13 +54,13 @@ Create a GitHub Personal Access Token that has `admin:repo_hook` for full contro
5454

5555
```hcl
5656
module "github_webhooks" {
57-
source = "git::https://github.com/cloudposse/terraform-github-repository-webhooks.git?ref=master"
58-
github_organization = "cloudposse"
59-
github_token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
60-
github_repositories = "geodesic"
61-
webhook_url = "https://atlantis.prod.company.com/"
62-
content_type = "application/json"
63-
events = ["issues"]
57+
source = "git::https://github.com/cloudposse/terraform-github-repository-webhooks.git?ref=master"
58+
github_organization = "cloudposse"
59+
github_token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
60+
github_repositories = "geodesic"
61+
webhook_url = "https://atlantis.prod.company.com/"
62+
webhook_content_type = "application/json"
63+
events = ["issues"]
6464
}
6565
```
6666

@@ -83,12 +83,12 @@ Available targets:
8383

8484
| Name | Description | Type | Default | Required |
8585
|------|-------------|:----:|:-----:|:-----:|
86-
| active | Indicate of the webhook should receive events. | string | `true` | no |
86+
| active | Indicate of the webhook should receive events | string | `true` | no |
8787
| enabled | Whether or not to enable this module | string | `true` | no |
8888
| events | A list of events which should trigger the webhook. | list | `<list>` | no |
89-
| github_organization | GitHub organization to use when creating webhook | string | - | yes |
89+
| github_organization | GitHub organization to use when creating webhooks | string | - | yes |
9090
| github_repositories | List of repository names which should be associated with the webhook | list | `<list>` | no |
91-
| github_token | GitHub token used for API access | string | - | yes |
91+
| github_token | GitHub token used for API access. If not provided, can be sourced from the `GITHUB_TOKEN` environment variable | string | `` | no |
9292
| webhook_content_type | Webhook Content Type (E.g. json) | string | `json` | no |
9393
| webhook_insecure_ssl | Webhook Insecure SSL (E.g. trust self-signed certificates) | string | `false` | no |
9494
| webhook_secret | Webhook secret | string | `` | no |

README.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ github_repo: cloudposse/terraform-github-repository-webhooks
1515

1616
# Short description of this project
1717
description: |-
18-
Terraform module to provision webhooks on a set of GitHub repositories.
18+
Terraform module to provision webhooks on a set of GitHub repositories.
1919
This is useful if you need to register a webhook en masse across dozens of repositories.
2020
2121
# Badges to display
@@ -36,13 +36,13 @@ usage: |-
3636
3737
```hcl
3838
module "github_webhooks" {
39-
source = "git::https://github.com/cloudposse/terraform-github-repository-webhooks.git?ref=master"
40-
github_organization = "cloudposse"
41-
github_token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
42-
github_repositories = "geodesic"
43-
webhook_url = "https://atlantis.prod.company.com/"
44-
content_type = "application/json"
45-
events = ["issues"]
39+
source = "git::https://github.com/cloudposse/terraform-github-repository-webhooks.git?ref=master"
40+
github_organization = "cloudposse"
41+
github_token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
42+
github_repositories = "geodesic"
43+
webhook_url = "https://atlantis.prod.company.com/"
44+
webhook_content_type = "application/json"
45+
events = ["issues"]
4646
}
4747
```
4848

docs/terraform.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
| Name | Description | Type | Default | Required |
44
|------|-------------|:----:|:-----:|:-----:|
5-
| active | Indicate of the webhook should receive events. | string | `true` | no |
5+
| active | Indicate of the webhook should receive events | string | `true` | no |
66
| enabled | Whether or not to enable this module | string | `true` | no |
77
| events | A list of events which should trigger the webhook. | list | `<list>` | no |
8-
| github_organization | GitHub organization to use when creating webhook | string | - | yes |
8+
| github_organization | GitHub organization to use when creating webhooks | string | - | yes |
99
| github_repositories | List of repository names which should be associated with the webhook | list | `<list>` | no |
10-
| github_token | GitHub token used for API access | string | - | yes |
10+
| github_token | GitHub token used for API access. If not provided, can be sourced from the `GITHUB_TOKEN` environment variable | string | `` | no |
1111
| webhook_content_type | Webhook Content Type (E.g. json) | string | `json` | no |
1212
| webhook_insecure_ssl | Webhook Insecure SSL (E.g. trust self-signed certificates) | string | `false` | no |
1313
| webhook_secret | Webhook secret | string | `` | no |

examples/simple/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
variable "github_token" {
2-
description = "GitHub token used for API access"
2+
default = ""
3+
description = "GitHub token used for API access. If not provided, can be sourced from the `GITHUB_TOKEN` environment variable"
34
}
45

56
module "webhooks" {

variables.tf

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@ variable "enabled" {
44
}
55

66
variable "github_token" {
7-
description = "GitHub token used for API access"
7+
default = ""
8+
description = "GitHub token used for API access. If not provided, can be sourced from the `GITHUB_TOKEN` environment variable"
89
}
910

1011
variable "github_organization" {
11-
description = "GitHub organization to use when creating webhook"
12+
description = "GitHub organization to use when creating webhooks"
1213
}
1314

1415
variable "github_repositories" {
@@ -37,7 +38,7 @@ variable "webhook_insecure_ssl" {
3738
}
3839

3940
variable "active" {
40-
description = "Indicate of the webhook should receive events."
41+
description = "Indicate of the webhook should receive events"
4142
default = true
4243
}
4344

0 commit comments

Comments
 (0)