diff --git a/github/Repository.py b/github/Repository.py index a08be2d7..07242005 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -954,7 +954,12 @@ class Repository(github.GithubObject.CompletableGithubObject): ): self.create_git_tag(tag, tag_message, object, type, tagger) return self.create_git_release( - tag, release_name, release_message, draft, prerelease + tag, + release_name, + release_message, + draft, + prerelease, + target_commitish=object, ) def create_git_release( diff --git a/tests/ReplayData/Release.testCreateGitTagAndRelease.txt b/tests/ReplayData/Release.testCreateGitTagAndRelease.txt index 2c43077b..034649aa 100644 --- a/tests/ReplayData/Release.testCreateGitTagAndRelease.txt +++ b/tests/ReplayData/Release.testCreateGitTagAndRelease.txt @@ -37,7 +37,7 @@ api.github.com None /repos/edhollandAL/PyGithub/releases {'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} -{"body": "release message", "prerelease": false, "tag_name": "v3.0.0", "draft": false, "name": "release title"} +{"body": "release message", "prerelease": false, "tag_name": "v3.0.0", "draft": false, "name": "release title", "target_commitish": "5a05a5e58f682d315acd2447c87ac5b4d4fc55e8"} 201 [('content-length', '1648'), ('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('x-served-by', 'd594a23ec74671eba905bf91ef329026'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('etag', '"7e6e27a070b656e2058a8c62f0648a57"'), ('location', 'https://api.github.com/repos/edhollandAL/PyGithub/releases/1210902'), ('access-control-allow-credentials', 'true'), ('status', '201 Created'), ('x-ratelimit-remaining', '4934'), ('x-github-media-type', 'github.v3; format=json'), ('access-control-expose-headers', 'ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval'), ('x-github-request-id', '56BCFFD3:54C9:7C07BE1:553A0689'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('date', 'Fri, 24 Apr 2015 09:02:02 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1429867683')] {"url":"https://api.github.com/repos/edhollandAL/PyGithub/releases/1210902","assets_url":"https://api.github.com/repos/edhollandAL/PyGithub/releases/1210902/assets","upload_url":"https://uploads.github.com/repos/edhollandAL/PyGithub/releases/1210902/assets{?name}","html_url":"https://github.com/edhollandAL/PyGithub/releases/tag/v3.0.0","id":1210902,"tag_name":"v3.0.0","target_commitish":"master","name":"release title","draft":false,"author":{"login":"edhollandAL","id":11922660,"avatar_url":"https://avatars.githubusercontent.com/u/11922660?v=3","gravatar_id":"","url":"https://api.github.com/users/edhollandAL","html_url":"https://github.com/edhollandAL","followers_url":"https://api.github.com/users/edhollandAL/followers","following_url":"https://api.github.com/users/edhollandAL/following{/other_user}","gists_url":"https://api.github.com/users/edhollandAL/gists{/gist_id}","starred_url":"https://api.github.com/users/edhollandAL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edhollandAL/subscriptions","organizations_url":"https://api.github.com/users/edhollandAL/orgs","repos_url":"https://api.github.com/users/edhollandAL/repos","events_url":"https://api.github.com/users/edhollandAL/events{/privacy}","received_events_url":"https://api.github.com/users/edhollandAL/received_events","type":"User","site_admin":false},"prerelease":false,"created_at":"2015-04-15T20:53:41Z","published_at":"2015-04-24T09:02:02Z","assets":[],"tarball_url":"https://api.github.com/repos/edhollandAL/PyGithub/tarball/v3.0.0","zipball_url":"https://api.github.com/repos/edhollandAL/PyGithub/zipball/v3.0.0","body":"release message"}