Skip to content

Commit 2a21ca7

Browse files
refactor!: Align RepositoryRelease with the Release schema
Remove the input-only fields MakeLatest, DiscussionCategoryName and GenerateReleaseNotes from RepositoryRelease — these are carried by CreateReleaseRequest/UpdateReleaseRequest and are not part of the Release response schema. Add the response fields that were missing compared to the schema: UpdatedAt, BodyHTML, BodyText, MentionsCount, DiscussionURL and Reactions. Regenerate the accessors and stringify tests accordingly.
1 parent b2563e2 commit 2a21ca7

4 files changed

Lines changed: 144 additions & 87 deletions

File tree

‎github/github-accessors.go‎

Lines changed: 41 additions & 17 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎github/github-accessors_test.go‎

Lines changed: 52 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎github/github-stringify_test.go‎

Lines changed: 26 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎github/repos_releases.go‎

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -19,31 +19,31 @@ import (
1919

2020
// RepositoryRelease represents a GitHub release in a repository.
2121
type RepositoryRelease struct {
22-
TagName *string `json:"tag_name,omitempty"`
23-
TargetCommitish *string `json:"target_commitish,omitempty"`
24-
Name *string `json:"name,omitempty"`
25-
Body *string `json:"body,omitempty"`
26-
Draft *bool `json:"draft,omitempty"`
27-
Prerelease *bool `json:"prerelease,omitempty"`
28-
// MakeLatest can be one of: "true", "false", or "legacy".
29-
MakeLatest *string `json:"make_latest,omitempty"`
30-
DiscussionCategoryName *string `json:"discussion_category_name,omitempty"`
31-
32-
GenerateReleaseNotes *bool `json:"generate_release_notes,omitempty"`
33-
34-
ID *int64 `json:"id,omitempty"`
35-
CreatedAt *Timestamp `json:"created_at,omitempty"`
36-
PublishedAt *Timestamp `json:"published_at,omitempty"`
37-
URL *string `json:"url,omitempty"`
38-
HTMLURL *string `json:"html_url,omitempty"`
39-
AssetsURL *string `json:"assets_url,omitempty"`
40-
Assets []*ReleaseAsset `json:"assets,omitempty"`
41-
UploadURL *string `json:"upload_url,omitempty"`
42-
ZipballURL *string `json:"zipball_url,omitempty"`
43-
TarballURL *string `json:"tarball_url,omitempty"`
44-
Author *User `json:"author,omitempty"`
45-
NodeID *string `json:"node_id,omitempty"`
46-
Immutable *bool `json:"immutable,omitempty"`
22+
TagName *string `json:"tag_name,omitempty"`
23+
TargetCommitish *string `json:"target_commitish,omitempty"`
24+
Name *string `json:"name,omitempty"`
25+
Body *string `json:"body,omitempty"`
26+
Draft *bool `json:"draft,omitempty"`
27+
Prerelease *bool `json:"prerelease,omitempty"`
28+
Immutable *bool `json:"immutable,omitempty"`
29+
ID *int64 `json:"id,omitempty"`
30+
CreatedAt *Timestamp `json:"created_at,omitempty"`
31+
PublishedAt *Timestamp `json:"published_at,omitempty"`
32+
UpdatedAt *Timestamp `json:"updated_at,omitempty"`
33+
URL *string `json:"url,omitempty"`
34+
HTMLURL *string `json:"html_url,omitempty"`
35+
AssetsURL *string `json:"assets_url,omitempty"`
36+
Assets []*ReleaseAsset `json:"assets,omitempty"`
37+
UploadURL *string `json:"upload_url,omitempty"`
38+
ZipballURL *string `json:"zipball_url,omitempty"`
39+
TarballURL *string `json:"tarball_url,omitempty"`
40+
Author *User `json:"author,omitempty"`
41+
NodeID *string `json:"node_id,omitempty"`
42+
BodyHTML *string `json:"body_html,omitempty"`
43+
BodyText *string `json:"body_text,omitempty"`
44+
MentionsCount *int `json:"mentions_count,omitempty"`
45+
DiscussionURL *string `json:"discussion_url,omitempty"`
46+
Reactions *Reactions `json:"reactions,omitempty"`
4747
}
4848

4949
func (r RepositoryRelease) String() string {

0 commit comments

Comments
 (0)