You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The provider resolves credentials using the following fallback chain (first match wins):
278
+
279
+
1.**Token** — `token` attribute or `GITHUB_TOKEN` env var
280
+
2.**GitHub App** — `app_auth` block with `id`, `installation_id`, and `pem_file`
281
+
3.**GitHub CLI** — Falls back to `gh auth token` if neither token nor app_auth is set
282
+
4.**Anonymous** — Read-only access when no credentials are available
283
+
284
+
All authentication configuration is handled in `config.go`. See the [Explicit Authentication Configuration](#explicit-authentication-configuration) decision for design rationale.
Use `skipUnauthenticated(t)`, `skipUnlessHasOrgs(t)`, `skipUnlessHasPaidOrgs(t)`, `skipUnlessEnterprise(t)`, `skipUnlessMode(t, testModes...)` functions to run tests in appropriate contexts:
530
+
Use these skip functions to run tests in appropriate contexts:
531
+
532
+
-`skipUnauthenticated(t)` — skips if anonymous mode
533
+
-`skipUnlessHasOrgs(t)` — requires organization, team, or enterprise mode
534
+
-`skipUnlessHasPaidOrgs(t)` — requires team or enterprise mode (paid orgs)
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+11-1Lines changed: 11 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,7 +144,17 @@ The following provider development overrides are set in the CLI configuration:
144
144
145
145
See the [Environment Variable Reference](#environment-variable-reference) below for the full list of configuration options.
146
146
147
-
There are also a small amount of unit tests in the provider. Due to the nature of the provider, such tests are currently only recommended for exercising functionality completely internal to the provider. These may be executed by running `make test`.
147
+
There are also a small number of unit tests in the provider. Due to the nature of the provider, such tests are currently only recommended for exercising functionality completely internal to the provider. These may be executed by running `make test`.
148
+
149
+
### Cleaning Up Test Resources
150
+
151
+
Acceptance tests create real GitHub resources prefixed with `tf-acc-test-`. If tests fail or are interrupted, these resources may be left behind. Run the sweeper to clean them up:
152
+
153
+
```sh
154
+
make sweep
155
+
```
156
+
157
+
This removes leaked test repositories and teams matching the `tf-acc-test-` prefix.
This project is used to manipulate GitHub resources (repositories, teams, files, etc.) using Terraform. Its Terraform Registry page can be found [here](https://registry.terraform.io/providers/integrations/github/).
7
+
This provider manages GitHub resources — repositories, teams, branch protections, actions secrets/variables, organization settings, rulesets, deploy keys, webhooks, and more — using Terraform. It supports both GitHub.com and GitHub Enterprise Server via the REST and GraphQL APIs.
8
+
9
+
See the [GitHub Provider page on the Terraform Registry](https://registry.terraform.io/providers/integrations/github/) for installation and documentation.
10
+
11
+
## Quick Start
12
+
13
+
```hcl
14
+
provider "github" {
15
+
owner = "my-org"
16
+
}
17
+
18
+
resource "github_repository" "example" {
19
+
name = "example-repo"
20
+
description = "Managed by Terraform"
21
+
visibility = "private"
22
+
}
23
+
```
9
24
10
25
## Requirements
11
26
@@ -14,11 +29,11 @@ This project is used to manipulate GitHub resources (repositories, teams, files,
14
29
15
30
## Usage
16
31
17
-
Detailed documentation for the GitHub provider can be found [here](https://registry.terraform.io/providers/integrations/github).
32
+
Comprehensive documentation for the GitHub Terraform provider is available on the [Terraform Registry – GitHub Provider page](https://registry.terraform.io/providers/integrations/github).
18
33
19
34
## Contributing
20
35
21
-
Detailed documentation for contributing to the GitHub provider can be found [here](CONTRIBUTING.md).
36
+
For instructions on how to contribute to the GitHub Terraform provider, see the [Contributing Guide](CONTRIBUTING.md).
0 commit comments