Repository navigation
chore: Update go-github to v93.0.0 - #3685
benlangfeld wants to merge 1 commit into
Conversation
v93 renames four request types, passes them by value, and replaces the `*Repository` the create endpoint took with a `CreateRepositoryRequest`. - `RepositoryAddCollaboratorOptions` -> `AddCollaboratorRequest` - `TeamAddTeamMembershipOptions` -> `AddTeamMembershipRequest` - `TeamAddTeamRepoOptions` -> `AddTeamRepoRequest` - `RepositoryCreateForkOptions` -> `CreateForkRequest` Each is now passed by value, and the fields the provider sets on them have become pointers, so they are wrapped. Separately, a set of required body fields stopped being pointers (google/go-github#4581), so eleven struct literals no longer take an address. `repositoryCreateRequest` maps a repository onto the narrower body the create endpoint accepts. Four fields the provider sets have no place in it - topics, archived, has_downloads and security_and_analysis - and the create endpoint has never accepted them. Topics are sent by ReplaceAllTopics, and the rest by the update that create delegates to once the repository exists, so all four still land. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
👋 Hi, and thank you for this contribution! This repo is maintained by GitHub and community members on a best-effort basis. We'll get to this as soon as we can. You can help us prioritize by joining the discussion on open issues and PRs, sharing details on the changes you need, and reviewing other contributions. 🤖 This is an automated message. |
|
How does this resolve #3651? |
| t.Helper() | ||
|
|
||
| _, _, err := testAccConf.meta.v3client.Repositories.AddCollaborator(t.Context(), testAccConf.meta.name, repo.GetName(), username, &github.RepositoryAddCollaboratorOptions{Permission: "push"}) | ||
| _, _, err := testAccConf.meta.v3client.Repositories.AddCollaborator(t.Context(), testAccConf.meta.name, repo.GetName(), username, github.AddCollaboratorRequest{Permission: github.Ptr("push")}) |
There was a problem hiding this comment.
I thought that github.Ptr was deprecated. Did you run linter on the changes?
There was a problem hiding this comment.
🟡 Changes recommended
The repository-create payload conversion needs targeted regression coverage to verify that configured settings remain preserved.
1 open finding
What changed in this PR
These provider review instructions are being used.
Upgrades the provider to go-github v93.0.0, enabling the dependency needed for ruleset dismissal restrictions in #3658.
Changes:
- Updates dependency versions and imports.
- Adapts request types and pointer/value fields to v93.
- Adds a repository-create request mapper and updates existing test callers.
| File | Description |
|---|---|
| internal/ghclient/token.go | Uses v93 client types. |
| internal/ghclient/token_test.go | Uses v93 test imports. |
| internal/ghclient/source.go | Uses v93 client types. |
| internal/ghclient/rest.go | Uses v93 REST client. |
| internal/ghclient/app.go | Uses v93 client types. |
| internal/ghclient/anonymous.go | Uses v93 client types. |
| internal/ghclient/anonymous_test.go | Uses v93 test imports. |
| go.sum | Updates dependency checksums. |
| go.mod | Pins go-github v93.0.0. |
| github/util.go | Updates v93 import. |
| github/util_team.go | Updates v93 import. |
| github/util_ruleset_validation.go | Updates v93 import. |
| github/util_ruleset_validation_test.go | Updates v93 test import. |
| github/util_rules.go | Updates v93 import. |
| github/util_rules_test.go | Updates v93 test import. |
| github/util_retry.go | Updates v93 import. |
| github/util_retry_test.go | Updates v93 test import. |
| github/util_repo.go | Updates v93 import. |
| github/util_labels.go | Updates v93 import. |
| github/util_diff.go | Updates v93 import. |
| github/transport.go | Updates v93 import. |
| github/transport_test.go | Adapts repository-create test requests. |
| github/resource_organization_block.go | Updates v93 import. |
| github/resource_github_workflow_repository_permissions.go | Updates v93 import. |
| github/resource_github_user_ssh_key.go | Updates v93 import. |
| github/resource_github_user_gpg_key.go | Updates v93 import. |
| github/resource_github_team.go | Updates v93 import. |
| github/resource_github_team_sync_group_mapping.go | Updates v93 import. |
| github/resource_github_team_sync_group_mapping_test.go | Updates v93 test import. |
| github/resource_github_team_repository.go | Adapts team repository requests. |
| github/resource_github_team_membership.go | Adapts membership requests. |
| github/resource_github_team_membership_test.go | Updates v93 test import. |
| github/resource_github_team_members.go | Adapts membership requests. |
| github/resource_github_team_members_migration_test.go | Updates v93 test import. |
| github/resource_github_repository.go | Adds create mapper; adapts fork requests. |
| github/resource_github_repository_webhook.go | Updates v93 import. |
| github/resource_github_repository_vulnerability_alerts.go | Updates v93 import. |
| github/resource_github_repository_topics.go | Updates v93 import. |
| github/resource_github_repository_ruleset.go | Updates v93 import. |
| github/resource_github_repository_ruleset_test.go | Updates v93 test import. |
| github/resource_github_repository_pull_request.go | Updates v93 import. |
| github/resource_github_repository_pages.go | Updates v93 import. |
| github/resource_github_repository_milestone.go | Updates v93 import. |
| github/resource_github_repository_file.go | Updates v93 import. |
| github/resource_github_repository_file_migration_test.go | Updates v93 test import. |
| github/resource_github_repository_environment.go | Updates v93 import. |
| github/resource_github_repository_environment_deployment_policy.go | Updates v93 import. |
| github/resource_github_repository_deployment_branch_policy.go | Updates v93 import. |
| github/resource_github_repository_deploy_key.go | Updates v93 import. |
| github/resource_github_repository_custom_property.go | Updates v93 import. |
| github/resource_github_repository_custom_property_migration.go | Updates v93 import. |
| github/resource_github_repository_custom_property_migration_test.go | Updates v93 test import. |
| github/resource_github_repository_collaborators.go | Adapts user and team permission requests. |
| github/resource_github_repository_collaborator.go | Adapts collaborator requests. |
| github/resource_github_repository_autolink_reference.go | Updates v93 import. |
| github/resource_github_release.go | Updates v93 import. |
| github/resource_github_release_migration_test.go | Updates v93 test import. |
| github/resource_github_project_column_test.go | Updates commented import only. |
| github/resource_github_organization_webhook.go | Updates v93 import. |
| github/resource_github_organization_settings.go | Updates v93 import. |
| github/resource_github_organization_security_manager.go | Updates v93 import. |
| github/resource_github_organization_ruleset.go | Updates v93 import. |
| github/resource_github_organization_role.go | Updates v93 import. |
| github/resource_github_organization_role_user.go | Updates v93 import. |
| github/resource_github_organization_role_team.go | Updates v93 import. |
| github/resource_github_organization_role_team_assignment.go | Updates v93 import. |
| github/resource_github_organization_repository_role.go | Updates v93 import. |
| github/resource_github_organization_project_test.go | Updates commented import only. |
| github/resource_github_organization_custom_role.go | Updates v93 import. |
| github/resource_github_organization_custom_properties.go | Updates v93 import. |
| github/resource_github_membership.go | Updates v93 import. |
| github/resource_github_membership_test.go | Updates v93 test import. |
| github/resource_github_issue.go | Updates v93 import. |
| github/resource_github_issue_labels.go | Updates v93 import. |
| github/resource_github_issue_label.go | Updates v93 import. |
| github/resource_github_enterprise_security_analysis_settings.go | Updates v93 import. |
| github/resource_github_enterprise_organization.go | Updates v93 import. |
| github/resource_github_enterprise_organization_test.go | Updates v93 test import. |
| github/resource_github_enterprise_actions_workflow_permissions.go | Updates v93 import. |
| github/resource_github_enterprise_actions_runner_group.go | Adapts runner-group request fields. |
| github/resource_github_enterprise_actions_permissions.go | Adapts enterprise permission fields. |
| github/resource_github_emu_group_mapping.go | Updates v93 import. |
| github/resource_github_dependabot_secret.go | Updates v93 import. |
| github/resource_github_dependabot_organization_secret.go | Updates v93 import. |
| github/resource_github_dependabot_organization_secret_repository.go | Updates v93 import. |
| github/resource_github_dependabot_organization_secret_repositories.go | Updates v93 import. |
| github/resource_github_codespaces_user_secret.go | Updates v93 import. |
| github/resource_github_codespaces_secret.go | Updates v93 import. |
| github/resource_github_codespaces_organization_secret.go | Updates v93 import. |
| github/resource_github_codespaces_organization_secret_repositories.go | Updates v93 import. |
| github/resource_github_branch.go | Updates v93 import. |
| github/resource_github_branch_protection_v3.go | Updates v93 import. |
| github/resource_github_branch_protection_v3_utils.go | Updates v93 import. |
| github/resource_github_branch_protection_v3_utils_test.go | Updates v93 test import. |
| github/resource_github_branch_default.go | Updates v93 import. |
| github/resource_github_branch_default_migration_test.go | Updates v93 test import. |
| github/resource_github_app_installation_repository.go | Updates v93 import. |
| github/resource_github_app_installation_repositories.go | Updates v93 import. |
| github/resource_github_actions_variable.go | Updates v93 import. |
| github/resource_github_actions_secret.go | Updates v93 import. |
| github/resource_github_actions_runner_group.go | Adapts runner-group name fields. |
| github/resource_github_actions_repository_permissions.go | Adapts Actions enabled fields. |
| github/resource_github_actions_repository_oidc_subject_claim_customization_template.go | Updates v93 import. |
| github/resource_github_actions_repository_access_level.go | Adapts access-level fields. |
| github/resource_github_actions_organization_workflow_permissions.go | Updates v93 import. |
| github/resource_github_actions_organization_variable.go | Updates v93 import. |
| github/resource_github_actions_organization_variable_repository.go | Updates v93 import. |
| github/resource_github_actions_organization_variable_repositories.go | Updates v93 import. |
| github/resource_github_actions_organization_secret.go | Updates v93 import. |
| github/resource_github_actions_organization_secret_repository.go | Updates v93 import. |
| github/resource_github_actions_organization_secret_repositories.go | Updates v93 import. |
| github/resource_github_actions_organization_permissions.go | Adapts organization permission fields. |
| github/resource_github_actions_organization_oidc_subject_claim_customization_template.go | Updates v93 import. |
| github/resource_github_actions_hosted_runner.go | Updates v93 import. |
| github/resource_github_actions_environment_variable.go | Updates v93 import. |
| github/resource_github_actions_environment_secret.go | Updates v93 import. |
| github/migration.go | Updates v93 import. |
| github/migration_test.go | Updates v93 test import. |
| github/data_source_github_team.go | Updates v93 import. |
| github/data_source_github_team_repositories.go | Updates v93 import. |
| github/data_source_github_team_members.go | Updates v93 import. |
| github/data_source_github_repository.go | Updates v93 import. |
| github/data_source_github_repository_webhooks.go | Updates v93 import. |
| github/data_source_github_repository_test.go | Updates v93 test import. |
| github/data_source_github_repository_teams.go | Updates v93 import. |
| github/data_source_github_repository_pull_requests.go | Updates v93 import. |
| github/data_source_github_repository_file.go | Updates v93 import. |
| github/data_source_github_repository_environments.go | Updates v93 import. |
| github/data_source_github_repository_environment_deployment_policies.go | Updates v93 import. |
| github/data_source_github_repository_deployment_branch_policies.go | Updates v93 import. |
| github/data_source_github_repository_deploy_keys.go | Updates v93 import. |
| github/data_source_github_repository_custom_properties.go | Updates v93 import. |
| github/data_source_github_repository_branches.go | Updates v93 import. |
| github/data_source_github_repository_autolink_references.go | Updates v93 import. |
| github/data_source_github_repositories.go | Updates v93 import. |
| github/data_source_github_release.go | Updates v93 import. |
| github/data_source_github_ref.go | Updates v93 import. |
| github/data_source_github_organization.go | Updates v93 import. |
| github/data_source_github_organization_webhooks.go | Updates v93 import. |
| github/data_source_github_organization_teams.go | Updates v93 import. |
| github/data_source_github_organization_team_sync_groups.go | Updates v93 import. |
| github/data_source_github_organization_role_users.go | Updates v93 import. |
| github/data_source_github_organization_role_teams.go | Updates v93 import. |
| github/data_source_github_organization_repositories.go | Updates v93 import. |
| github/data_source_github_organization_members.go | Updates v93 import. |
| github/data_source_github_organization_custom_role.go | Updates v93 import. |
| github/data_source_github_organization_app_installations.go | Updates v93 import. |
| github/data_source_github_external_groups.go | Updates v93 import. |
| github/data_source_github_dependabot_secrets.go | Updates v93 import. |
| github/data_source_github_dependabot_organization_secrets.go | Updates v93 import. |
| github/data_source_github_collaborators.go | Updates v93 import. |
| github/data_source_github_codespaces_user_secrets.go | Updates v93 import. |
| github/data_source_github_codespaces_secrets.go | Updates v93 import. |
| github/data_source_github_codespaces_organization_secrets.go | Updates v93 import. |
| github/data_source_github_branch.go | Updates v93 import. |
| github/data_source_github_actions_variables.go | Updates v93 import. |
| github/data_source_github_actions_secrets.go | Updates v93 import. |
| github/data_source_github_actions_repository_oidc_subject_claim_customization_template_test.go | Updates v93 test import. |
| github/data_source_github_actions_organization_variables.go | Updates v93 import. |
| github/data_source_github_actions_organization_secrets.go | Updates v93 import. |
| github/data_source_github_actions_organization_oidc_subject_claim_customization_template_test.go | Updates v93 test import. |
| github/data_source_github_actions_environment_variables.go | Updates v93 import. |
| github/data_source_github_actions_environment_secrets.go | Updates v93 import. |
| github/config.go | Updates v93 client import. |
| github/acc_test.go | Updates v93 test import. |
| github/acc_helpers_test.go | Adapts collaborator test requests. |
| github/acc_helpers_team_test.go | Adapts team test requests. |
| github/acc_helpers_repository_test.go | Uses repository-create mapper. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| func repositoryCreateRequest(repo *github.Repository) github.CreateRepositoryRequest { | ||
| return github.CreateRepositoryRequest{ |
|
Sorry, this was supposed to be in draft state still! |

Resolves #3651 in part, and unblocks #3658.
go-github v93.0.0 was released on 2026-10-15. This bumps the provider to it.
Before the change?
go-github/v92.dismissal_restrictionon ruleset pull request rules cannot be expressed, because the type only exists from v93 (google/go-github#4599). feat: Support dismissal_restriction on the ruleset pull_request rule #3658 is written and waiting on this bump to compile.After the change?
go-github/v93.What the upgrade actually required
v93 carries ten breaking changes. Four touch this provider:
Four request types renamed and passed by value, with the fields the provider sets becoming pointers (#4606, #4607):
RepositoryAddCollaboratorOptionsAddCollaboratorRequestTeamAddTeamMembershipOptionsAddTeamMembershipRequestTeamAddTeamRepoOptionsAddTeamRepoRequestRepositoryCreateForkOptionsCreateForkRequestRequired body fields stopped being pointers (#4581) — eleven struct literals no longer take an address. Note these move in the opposite direction to the four above, which is worth a careful eye in review; three of my first attempts were over-corrections the compiler caught.
RepositoriesService.CreatetakesCreateRepositoryRequestby value (#4616) — a narrower struct, not a renamedRepository. This is the only part that is not mechanical, and is described below.repositoryCreateRequestThe provider builds a
*github.Repositorywith 22 fields and passes it toCreate. Four of them have no place inCreateRepositoryRequest:topics,archived,has_downloadsandsecurity_and_analysis. GitHub's create endpoint has never accepted any of the four, so they were being sent and ignored; v93's typed request makes that explicit.All four still land:
topics—ReplaceAllTopics, immediately after create, as before.archived,has_downloads,security_and_analysis—resourceGithubRepositoryCreateends withreturn resourceGithubRepositoryUpdate(...), which rebuilds the full object throughresourceGithubRepositoryObject(d)and callsRepositories.Edit.So the observable behaviour is unchanged. I would still rather a maintainer confirmed that reading than take my word for it.
One thing this PR does not address
Warning
google/go-github#4564: "Credentials are sent only to a client's configured API and upload origins — every other destination, including a redirect hop, goes out unauthenticated…
BasicAuthTransportandUnauthenticatedRateLimitedTransportgainedAllowedOrigins, which GitHub Enterprise users must set."This produces no compile error, and the provider has no reference to
AllowedOrigins,BasicAuthTransportorUnauthenticatedRateLimitedTransport. The provider supports GHES throughbase_url, so there may be an enterprise-facing behaviour change here that nothing in the build or the tests will surface.I have deliberately not guessed at it: what the provider should do about enterprise origins is a maintainer's call about your users, not something to decide inside a dependency bump. Happy to implement whatever you would like, in this PR or a follow-up.
Testing
go build ./...,go vet ./...,gofmt -l— all clean.go test ./...excludingTestAcc*— passes.TestAccGithubActionsOrganizationPermissionspanics identically onmainwithout them, so that failure is pre-existing rather than introduced here.168 files, almost all of them the import path.