# dokploy_github_provider (Data Source)

Looks up a GitHub App registered in Dokploy (Git > GitHub).

Use it so `dokploy_application`'s `github_id` stops being a hardcoded opaque id:

```terraform
data "dokploy_github_provider" "main" {
  name = "my-org"
}

resource "dokploy_application" "web" {
  github = {
    github_id = data.dokploy_github_provider.main.id
    # ...
  }
}
```

~> **`id` here is the `githubId`, not the `gitProviderId`.** Dokploy keeps both — `git_provider_id` is the generic record, `id` is the GitHub-specific one — and an application references the GitHub-specific one. Passing the wrong id is accepted by validation and then fails with an HTTP 500, because the foreign key is only enforced at the database layer.

~> GitHub Apps cannot be created from Terraform. Dokploy's API has no `github.create`; installation is a browser flow. This data source reads what is already there.

## Example Usage

```terraform
# Look the GitHub App up by name instead of pasting an opaque id.
data "dokploy_github_provider" "main" {
  name = "vnly-io-dokploy"
}

resource "dokploy_application" "web" {
  name           = "web"
  environment_id = [for e in dokploy_project.example.environments : e.id if e.name == "production"][0]

  github = {
    owner      = "vanillauys"
    repository = "vanillauys-app"
    branch     = "master"
    # NOTE: `id`, not `git_provider_id` — an application references the
    # GitHub-specific record.
    github_id = data.dokploy_github_provider.main.id
  }
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Optional

- `id` (String) The `githubId`. Set this to look up by id, or leave it unset and set `name`. This is the value `dokploy_application.github.github_id` expects.
- `name` (String) Provider name as shown in Dokploy. Exactly one of `id` or `name` must be set.

### Read-Only

- `created_at` (String) Creation timestamp (server-side).
- `git_provider_id` (String) Id of the generic git-provider record this GitHub App hangs off. Not what an application references.
- `provider_type` (String) Always `github` for this data source.
- `shared_with_organization` (Boolean) Whether the provider is shared with the whole Dokploy organization.