diff --git a/github/GitRelease.py b/github/GitRelease.py index bf3f48e3..3b32e8f1 100644 --- a/github/GitRelease.py +++ b/github/GitRelease.py @@ -77,6 +77,14 @@ class GitRelease(github.GithubObject.CompletableGithubObject): self._completeIfNotSet(self._tag_name) return self._tag_name.value + @property + def target_commitish(self): + """ + :type: string + """ + self._completeIfNotSet(self._target_commitish) + return self._target_commitish.value + @property def draft(self): """ @@ -216,6 +224,7 @@ class GitRelease(github.GithubObject.CompletableGithubObject): self._body = github.GithubObject.NotSet self._title = github.GithubObject.NotSet self._tag_name = github.GithubObject.NotSet + self._target_commitish = github.GithubObject.NotSet self._draft = github.GithubObject.NotSet self._prerelease = github.GithubObject.NotSet self._author = github.GithubObject.NotSet @@ -236,6 +245,8 @@ class GitRelease(github.GithubObject.CompletableGithubObject): self._title = self._makeStringAttribute(attributes["name"]) if "tag_name" in attributes: self._tag_name = self._makeStringAttribute(attributes["tag_name"]) + if "target_commitish" in attributes: + self._target_commitish = self._makeStringAttribute(attributes["target_commitish"]) if "draft" in attributes: self._draft = self._makeBoolAttribute(attributes["draft"]) if "prerelease" in attributes: diff --git a/github/tests/GitRelease.py b/github/tests/GitRelease.py index 0dc9f80f..931681ff 100644 --- a/github/tests/GitRelease.py +++ b/github/tests/GitRelease.py @@ -62,6 +62,7 @@ class Release(Framework.TestCase): self.release = self.g.get_user().get_repo("PyGithub").get_releases()[0] self.assertEqual(self.release.id, 1210814) self.assertEqual(self.release.tag_name, "v1.25.2") + self.assertEqual(self.release.target_commitish, "master") self.assertEqual(self.release.upload_url, "https://uploads.github.com/repos/edhollandAL/PyGithub/releases/1210814/assets{?name}") self.assertEqual(self.release.body, "Body") self.assertEqual(self.release.title, "Test")