integrations / integrations/terraform-provider-github
[FEAT]: Expose remaining org attributes in github_organization_settings
- Dominant language
- Go
- Stars
- 1.2k
- Forks
- 1k
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 8
Description
### Describe the need
The `github_organization_settings` resource currently exposes only a subset of the attributes that `PATCH /orgs/{org}` accepts and that the upstream `go-github` library already models on the `Organization` struct. Configurations that need to manage these settings as code currently have to fall back to the GitHub UI / REST.
The following seven attributes are missing from the resource even though `go-github` v85's `Organization` struct already carries fields with matching JSON tags, so surfacing them is a mechanical change:
- `members_allowed_repository_creation_type` — listed in [`PATCH /orgs/{org}` docs](https://docs.github.com/en/rest/orgs/orgs?apiVersion=2022-11-28#update-an-organization) as a settable body parameter
- `two_factor_requirement_enabled`
- `members_can_delete_repositories`
- `members_can_invite_outside_collaborators`
- `members_can_delete_issues`
- `display_commenter_full_name_setting_enabled`
- `readers_can_create_discussions`
The five that are not already exposed by the `github_organization` data source (`members_can_delete_repositories`, `members_can_invite_outside_collaborators`, `members_can_delete_issues`, `display_commenter_full_name_setting_enabled`, `readers_can_create_discussions`) should also be added there for symmetry, matching the pattern from #1850.
This is the same shape of change as #3147 (which adds `members_can_change_repo_visibility`); they could be merged independently.
Out of scope for this issue:
- `members_can_change_repo_visibility` — already covered by #3147
- `deploy_keys_enabled_for_repositories` — listed in REST docs but missing from the `go-github` `Organization` struct; needs an upstream `go-github` change first
- `members_can_create_teams`, `members_can_view_dependency_insights` — REST docs only show these in GET responses; need empirical verification that PATCH accepts them before adding
### SDK Version
terraform-provider-github main (post v6.12, current HEAD `add2157906`)
### API Version
REST API 2022-11-28
### Code of Conduct
- [X] I agree to follow this project's Code of Conduct
Contributor guide
Assessment
This issue has not been assessed yet.