From 72c42fbbbd77b08f56b0cf1913bd41976c5d32c0 Mon Sep 17 00:00:00 2001 From: nakultt Date: Wed, 28 Oct 2026 14:53:40 +0530 Subject: [PATCH 1/2] docs: Deprecate removed Repository fields Mark HasDownloads and UseSquashPRTitleAsDefault as deprecated, since GitHub REST API version 2026-03-10 removed them. The fields are kept for older API versions and GHES. Updates #4077. --- github/repos.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/github/repos.go b/github/repos.go index e7671b2d20a..c3b1349b6e3 100644 --- a/github/repos.go +++ b/github/repos.go @@ -71,11 +71,11 @@ type Repository struct { AllowForking *bool `json:"allow_forking,omitempty"` WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"` DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` - UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` - SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" - SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK" - MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE" - MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK" + UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` // Deprecated: Removed in API version 2026-03-10. Use SquashMergeCommitTitle instead. + SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" + SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK" + MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE" + MergeCommitMessage *string `json:"merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "PR_TITLE", "BLANK" Topics []string `json:"topics,omitempty"` CustomProperties map[string]any `json:"custom_properties,omitempty"` Archived *bool `json:"archived,omitempty"` @@ -90,7 +90,7 @@ type Repository struct { HasWiki *bool `json:"has_wiki,omitempty"` HasPages *bool `json:"has_pages,omitempty"` HasProjects *bool `json:"has_projects,omitempty"` - HasDownloads *bool `json:"has_downloads,omitempty"` + HasDownloads *bool `json:"has_downloads,omitempty"` // Deprecated: Removed in API version 2026-03-10. HasDiscussions *bool `json:"has_discussions,omitempty"` HasPullRequests *bool `json:"has_pull_requests,omitempty"` PullRequestCreationPolicy *string `json:"pull_request_creation_policy,omitempty"` // Can be one of: "all", "collaborators_only" @@ -529,7 +529,7 @@ type CreateRepositoryRequest struct { AllowAutoMerge *bool `json:"allow_auto_merge,omitempty"` AllowForking *bool `json:"allow_forking,omitempty"` DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` - UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` + UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` // Deprecated: Removed in API version 2026-03-10. Use SquashMergeCommitTitle instead. SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` MergeCommitTitle *string `json:"merge_commit_title,omitempty"` From a74e53903dc6838143710c3fbc00645669a000f2 Mon Sep 17 00:00:00 2001 From: nakultt Date: Wed, 28 Oct 2026 22:19:03 +0530 Subject: [PATCH 2/2] Address review comments --- github/repos.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/github/repos.go b/github/repos.go index c3b1349b6e3..02742b5ff3c 100644 --- a/github/repos.go +++ b/github/repos.go @@ -71,7 +71,7 @@ type Repository struct { AllowForking *bool `json:"allow_forking,omitempty"` WebCommitSignoffRequired *bool `json:"web_commit_signoff_required,omitempty"` DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` - UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` // Deprecated: Removed in API version 2026-03-10. Use SquashMergeCommitTitle instead. + UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` // Deprecated: GitHub REST API version 2026-03-10 removes the UseSquashPRTitleAsDefault field. Use SquashMergeCommitTitle instead. SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "COMMIT_OR_PR_TITLE" SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` // Can be one of: "PR_BODY", "COMMIT_MESSAGES", "BLANK" MergeCommitTitle *string `json:"merge_commit_title,omitempty"` // Can be one of: "PR_TITLE", "MERGE_MESSAGE" @@ -90,7 +90,7 @@ type Repository struct { HasWiki *bool `json:"has_wiki,omitempty"` HasPages *bool `json:"has_pages,omitempty"` HasProjects *bool `json:"has_projects,omitempty"` - HasDownloads *bool `json:"has_downloads,omitempty"` // Deprecated: Removed in API version 2026-03-10. + HasDownloads *bool `json:"has_downloads,omitempty"` // Deprecated: GitHub REST API version 2026-03-10 removes the HasDownloads field. HasDiscussions *bool `json:"has_discussions,omitempty"` HasPullRequests *bool `json:"has_pull_requests,omitempty"` PullRequestCreationPolicy *string `json:"pull_request_creation_policy,omitempty"` // Can be one of: "all", "collaborators_only" @@ -529,7 +529,7 @@ type CreateRepositoryRequest struct { AllowAutoMerge *bool `json:"allow_auto_merge,omitempty"` AllowForking *bool `json:"allow_forking,omitempty"` DeleteBranchOnMerge *bool `json:"delete_branch_on_merge,omitempty"` - UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` // Deprecated: Removed in API version 2026-03-10. Use SquashMergeCommitTitle instead. + UseSquashPRTitleAsDefault *bool `json:"use_squash_pr_title_as_default,omitempty"` // Deprecated: GitHub REST API version 2026-03-10 removes the UseSquashPRTitleAsDefault field. Use SquashMergeCommitTitle instead. SquashMergeCommitTitle *string `json:"squash_merge_commit_title,omitempty"` SquashMergeCommitMessage *string `json:"squash_merge_commit_message,omitempty"` MergeCommitTitle *string `json:"merge_commit_title,omitempty"`