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

Set node_id in github_organization data source #1277

Merged
merged 5 commits into from
Sep 19, 2022
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
1 change: 1 addition & 0 deletions github/data_source_github_organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ func dataSourceGithubOrganizationRead(d *schema.ResourceData, meta interface{})
d.Set("login", organization.GetLogin())
d.Set("name", organization.GetName())
d.Set("orgname", name)
d.Set("node_id", organization.GetNodeID())
d.Set("description", organization.GetDescription())
d.Set("plan", planName)
d.Set("repositories", repoList)
Expand Down
2 changes: 2 additions & 0 deletions github/data_source_github_organization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ func TestAccGithubOrganizationDataSource(t *testing.T) {
check := resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr("data.github_organization.test", "login", testOrganization),
resource.TestCheckResourceAttrSet("data.github_organization.test", "name"),
resource.TestCheckResourceAttrSet("data.github_organization.test", "orgname"),
resource.TestCheckResourceAttrSet("data.github_organization.test", "node_id"),
resource.TestCheckResourceAttrSet("data.github_organization.test", "description"),
resource.TestCheckResourceAttrSet("data.github_organization.test", "plan"),
resource.TestCheckResourceAttrSet("data.github_organization.test", "repositories.#"),
Expand Down
7 changes: 5 additions & 2 deletions website/docs/d/organization.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ Use this data source to retrieve basic information about a GitHub Organization.
## Example Usage

```hcl
data "github_organization" "test" {
data "github_organization" "example" {
name = "github"
}
```

## Attributes Reference

* `name` - The name of the organization account
* `id` - The ID of the organization
* `node_id` - GraphQL global node id for use with v4 API
* `name` - The organization's public profile name
* `orgname` - The organization's name as used in URLs and the API
* `login` - The login of the organization account
* `description` - The description the organization account
* `plan` - The plan name for the organization account
Expand Down