2016-03-08 23:05:22 +01:00
|
|
|
---
|
|
|
|
layout: "github"
|
2016-04-07 16:26:01 +02:00
|
|
|
page_title: "Provider: GitHub"
|
2016-03-08 23:05:22 +01:00
|
|
|
sidebar_current: "docs-github-index"
|
|
|
|
description: |-
|
2016-04-07 16:26:01 +02:00
|
|
|
The GitHub provider is used to interact with GitHub organization resources.
|
2016-03-08 23:05:22 +01:00
|
|
|
---
|
|
|
|
|
2016-04-07 16:26:01 +02:00
|
|
|
# GitHub Provider
|
2016-03-08 23:05:22 +01:00
|
|
|
|
2016-05-09 20:22:53 +02:00
|
|
|
The GitHub provider is used to interact with GitHub organization resources.
|
2016-03-08 23:05:22 +01:00
|
|
|
|
2016-05-09 20:22:53 +02:00
|
|
|
The provider allows you to manage your GitHub organization's members and teams easily.
|
2016-03-08 23:05:22 +01:00
|
|
|
It needs to be configured with the proper credentials before it can be used.
|
|
|
|
|
|
|
|
Use the navigation to the left to read about the available resources.
|
|
|
|
|
|
|
|
## Example Usage
|
|
|
|
|
|
|
|
```
|
2016-04-07 16:26:01 +02:00
|
|
|
# Configure the GitHub Provider
|
2016-03-08 23:05:22 +01:00
|
|
|
provider "github" {
|
|
|
|
token = "${var.github_token}"
|
|
|
|
organization = "${var.github_organization}"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Add a user to the organization
|
|
|
|
resource "github_membership" "membership_for_user_x" {
|
|
|
|
...
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
## Argument Reference
|
|
|
|
|
|
|
|
The following arguments are supported in the `provider` block:
|
|
|
|
|
2016-04-07 16:26:01 +02:00
|
|
|
* `token` - (Optional) This is the GitHub personal access token. It must be provided, but
|
2016-03-08 23:05:22 +01:00
|
|
|
it can also be sourced from the `GITHUB_TOKEN` environment variable.
|
|
|
|
|
2016-04-07 16:26:01 +02:00
|
|
|
* `organization` - (Optional) This is the target GitHub organization to manage. The account
|
2016-03-08 23:05:22 +01:00
|
|
|
corresponding to the token will need "owner" privileges for this organization. It must be provided, but
|
|
|
|
it can also be sourced from the `GITHUB_ORGANIZATION` environment variable.
|
2016-05-09 20:22:53 +02:00
|
|
|
|
|
|
|
* `base_url` - (Optional) This is the target GitHub base API endpoint. Providing a value is a
|
|
|
|
requirement when working with GitHub Enterprise. It is optional to provide this value and
|
|
|
|
it can also be sourced from the `GITHUB_BASE_URL` environment variable. The value must end with a slash.
|