Skip to content

feat: add display_name filter to github_external_groups data source#3410

Open
mattias-fjellstrom wants to merge 1 commit into
integrations:mainfrom
mattias-fjellstrom:mattias-fjellstrom/feat-external-groups-display-name-filter
Open

feat: add display_name filter to github_external_groups data source#3410
mattias-fjellstrom wants to merge 1 commit into
integrations:mainfrom
mattias-fjellstrom:mattias-fjellstrom/feat-external-groups-display-name-filter

Conversation

@mattias-fjellstrom
Copy link
Copy Markdown

Summary

Adds an optional display_name argument to the github_external_groups data source. When provided, it filters external groups server-side using the GitHub API's display_name query parameter, reducing the amount of data returned and stored in state.

Closes #3409

Changes

  • github/data_source_github_external_groups.go — Added display_name optional string attribute to the schema; passes it to ListExternalGroupsOptions.DisplayName when set; includes display_name in the resource ID for uniqueness
  • github/data_source_github_external_groups_test.go — New acceptance tests for both filtered and unfiltered queries (gated by skipUnlessEMUEnterprise)
  • examples/data-sources/external_groups/example_2.tf — New example showing filtered usage
  • templates/data-sources/external_groups.md.tmpl + docs/data-sources/external_groups.md — Updated documentation with new argument and example

Usage

# Fetch all external groups (existing behavior, unchanged)
data "github_external_groups" "all" {}

# Fetch external groups filtered by display name (new)
data "github_external_groups" "filtered" {
  display_name = "my-group"
}

Notes

  • The go-github SDK v85 ListExternalGroupsOptions already supports the DisplayName field — no SDK changes needed
  • Fully backwards compatible — display_name is optional and defaults to no filter

Add an optional display_name argument to the github_external_groups
data source. When provided, it filters external groups server-side
using the GitHub API's display_name query parameter, reducing the
amount of data returned and stored in state.

Changes:
- Add display_name optional string attribute to data source schema
- Pass display_name to ListExternalGroupsOptions when set
- Include display_name in resource ID for uniqueness
- Add acceptance tests for both filtered and unfiltered queries
- Update documentation and add filtered usage example

Closes integrations#3409

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labeled with Status: Up for grabs. You & others like you are the reason all of this works! So thank you & happy coding! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT]: Support filtering github_external_groups data source using display_name argument

1 participant