Skip to content

Commit 138500e

Browse files
authored
feat: Add immutable releases support (#3725)
1 parent 49c0748 commit 138500e

File tree

5 files changed

+27
-2
lines changed

5 files changed

+27
-2
lines changed

github/github-accessors.go

Lines changed: 8 additions & 0 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: 11 additions & 0 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: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/repos_releases.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ type RepositoryRelease struct {
4545
TarballURL *string `json:"tarball_url,omitempty"`
4646
Author *User `json:"author,omitempty"`
4747
NodeID *string `json:"node_id,omitempty"`
48+
Immutable *bool `json:"immutable,omitempty"`
4849
}
4950

5051
func (r RepositoryRelease) String() string {

github/repos_releases_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ func TestRepositoriesService_CreateRelease(t *testing.T) {
221221
TarballURL: Ptr("http://tarballurl/"),
222222
Author: &User{Name: Ptr("octocat")},
223223
NodeID: Ptr("nodeid"),
224+
Immutable: Ptr(false),
224225
}
225226

226227
mux.HandleFunc("/repos/o/r/releases", func(w http.ResponseWriter, r *http.Request) {
@@ -290,6 +291,7 @@ func TestRepositoriesService_EditRelease(t *testing.T) {
290291
TarballURL: Ptr("http://tarballurl/"),
291292
Author: &User{Name: Ptr("octocat")},
292293
NodeID: Ptr("nodeid"),
294+
Immutable: Ptr(false),
293295
}
294296

295297
mux.HandleFunc("/repos/o/r/releases/1", func(w http.ResponseWriter, r *http.Request) {
@@ -875,6 +877,7 @@ func TestRepositoryRelease_Marshal(t *testing.T) {
875877
TarballURL: Ptr("turl"),
876878
Author: &User{ID: Ptr(int64(1))},
877879
NodeID: Ptr("nid"),
880+
Immutable: Ptr(true),
878881
}
879882

880883
want := `{
@@ -903,7 +906,8 @@ func TestRepositoryRelease_Marshal(t *testing.T) {
903906
"author": {
904907
"id": 1
905908
},
906-
"node_id": "nid"
909+
"node_id": "nid",
910+
"immutable": true
907911
}`
908912

909913
testJSONMarshal(t, u, want)

0 commit comments

Comments
 (0)