Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make github_token optional #9

Merged
merged 2 commits into from
May 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![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)


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


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

```hcl
module "github_webhooks" {
source = "git::https://github.com/cloudposse/terraform-github-repository-webhooks.git?ref=master"
github_organization = "cloudposse"
github_token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
github_repositories = "geodesic"
webhook_url = "https://atlantis.prod.company.com/"
content_type = "application/json"
events = ["issues"]
source = "git::https://github.com/cloudposse/terraform-github-repository-webhooks.git?ref=master"
github_organization = "cloudposse"
github_token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
github_repositories = "geodesic"
webhook_url = "https://atlantis.prod.company.com/"
webhook_content_type = "application/json"
events = ["issues"]
}
```

Expand All @@ -83,12 +83,12 @@ Available targets:

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| active | Indicate of the webhook should receive events. | string | `true` | no |
| active | Indicate of the webhook should receive events | string | `true` | no |
| enabled | Whether or not to enable this module | string | `true` | no |
| events | A list of events which should trigger the webhook. | list | `<list>` | no |
| github_organization | GitHub organization to use when creating webhook | string | - | yes |
| 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 | `<list>` | no |
| github_token | GitHub token used for API access | string | - | yes |
| 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) | string | `false` | no |
| webhook_secret | Webhook secret | string | `` | no |
Expand Down
16 changes: 8 additions & 8 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ github_repo: cloudposse/terraform-github-repository-webhooks

# Short description of this project
description: |-
Terraform module to provision webhooks on a set of GitHub repositories.
Terraform module to provision webhooks on a set of GitHub repositories.
This is useful if you need to register a webhook en masse across dozens of repositories.
# Badges to display
Expand All @@ -36,13 +36,13 @@ usage: |-
```hcl
module "github_webhooks" {
source = "git::https://github.com/cloudposse/terraform-github-repository-webhooks.git?ref=master"
github_organization = "cloudposse"
github_token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
github_repositories = "geodesic"
webhook_url = "https://atlantis.prod.company.com/"
content_type = "application/json"
events = ["issues"]
source = "git::https://github.com/cloudposse/terraform-github-repository-webhooks.git?ref=master"
github_organization = "cloudposse"
github_token = "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
github_repositories = "geodesic"
webhook_url = "https://atlantis.prod.company.com/"
webhook_content_type = "application/json"
events = ["issues"]
}
```
Expand Down
6 changes: 3 additions & 3 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| active | Indicate of the webhook should receive events. | string | `true` | no |
| active | Indicate of the webhook should receive events | string | `true` | no |
| enabled | Whether or not to enable this module | string | `true` | no |
| events | A list of events which should trigger the webhook. | list | `<list>` | no |
| github_organization | GitHub organization to use when creating webhook | string | - | yes |
| 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 | `<list>` | no |
| github_token | GitHub token used for API access | string | - | yes |
| 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) | string | `false` | no |
| webhook_secret | Webhook secret | string | `` | no |
Expand Down
3 changes: 2 additions & 1 deletion examples/simple/main.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
variable "github_token" {
description = "GitHub token used for API access"
default = ""
description = "GitHub token used for API access. If not provided, can be sourced from the `GITHUB_TOKEN` environment variable"
}

module "webhooks" {
Expand Down
7 changes: 4 additions & 3 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ variable "enabled" {
}

variable "github_token" {
description = "GitHub token used for API access"
default = ""
description = "GitHub token used for API access. If not provided, can be sourced from the `GITHUB_TOKEN` environment variable"
}

variable "github_organization" {
description = "GitHub organization to use when creating webhook"
description = "GitHub organization to use when creating webhooks"
}

variable "github_repositories" {
Expand Down Expand Up @@ -37,7 +38,7 @@ variable "webhook_insecure_ssl" {
}

variable "active" {
description = "Indicate of the webhook should receive events."
description = "Indicate of the webhook should receive events"
default = true
}

Expand Down