From 25ca2e9b8b369e8aae554ba526a485d5dce790e3 Mon Sep 17 00:00:00 2001 From: Doug Ayers Date: Mon, 5 Sep 2022 23:43:45 -0500 Subject: [PATCH 1/3] fix: add missing node_id --- github/data_source_github_organization.go | 1 + 1 file changed, 1 insertion(+) diff --git a/github/data_source_github_organization.go b/github/data_source_github_organization.go index d181ee3ea0..88719a445f 100644 --- a/github/data_source_github_organization.go +++ b/github/data_source_github_organization.go @@ -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) From 958ed984721baf34ef33a0d29f8fa63aa193e4aa Mon Sep 17 00:00:00 2001 From: Doug Ayers Date: Mon, 5 Sep 2022 23:44:03 -0500 Subject: [PATCH 2/3] test: check for all fields in schema --- github/data_source_github_organization_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/github/data_source_github_organization_test.go b/github/data_source_github_organization_test.go index a803a460f6..23a35f72a1 100644 --- a/github/data_source_github_organization_test.go +++ b/github/data_source_github_organization_test.go @@ -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.#"), From 6f36d03dc5e1cc0ee5ae737a967c8c7dc4bb427a Mon Sep 17 00:00:00 2001 From: Doug Ayers Date: Tue, 6 Sep 2022 00:10:39 -0500 Subject: [PATCH 3/3] doc: add id, node_id, and orgname --- website/docs/d/organization.html.markdown | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/website/docs/d/organization.html.markdown b/website/docs/d/organization.html.markdown index 8086b9de8d..e9f53afb9c 100644 --- a/website/docs/d/organization.html.markdown +++ b/website/docs/d/organization.html.markdown @@ -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