layout | page_title | description |
---|---|---|
github |
Provider: GitHub |
The GitHub provider is used to interact with GitHub resources. |
The GitHub provider is used to interact with GitHub resources.
The provider allows you to manage your GitHub organization's members and teams easily. 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.
# Configure the GitHub Provider
provider "github" {
token = "${var.github_token}"
owner = "${var.github_owner}"
}
# Add a user to the organization
resource "github_membership" "membership_for_user_x" {
# ...
}
The following arguments are supported in the provider
block:
-
token
- (Optional) A GitHub OAuth / Personal Access Token. When not provided or made available via theGITHUB_TOKEN
environment variable, the provider can only access resources available anonymously. -
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 theGITHUB_BASE_URL
environment variable. The value must end with a slash, for example:https://terraformtesting-ghe.westus.cloudapp.azure.com/
-
owner
- (Optional) This is the target GitHub individual account to manage. It is optional to provide this value and it can also be sourced from theGITHUB_OWNER
environment variable. For example,torvalds
is a valid owner. When not provided and atoken
is available, the individual account owning thetoken
will be used. When not provided and notoken
is available, the provider may not function correctly. Conflicts withorganization
. -
organization
- (Optional) This is the target GitHub organization account to manage. It is optional to provide this value and it can also be sourced from theGITHUB_ORGANIZATION
environment variable. For example,github
is a valid organization. Conflicts withowner
and requirestoken
, as the individual account corresponding to providedtoken
will need "owner" privileges for this organization.