diff --git a/autorelease/github_release.py b/autorelease/github_release.py index 0a03c80..0d2930c 100644 --- a/autorelease/github_release.py +++ b/autorelease/github_release.py @@ -83,14 +83,15 @@ def find_relevant_pr(self): commit = next(commits) return int(pr_number) - def get_pr_body(self, pr_number): + def get_pr_data(self, pr_number): pr_url = self.repo_api_url + "issues/" + str(pr_number) - pr_body = requests.get(pr_url).json()['body'] - return pr_body + pr_data = requests.get(pr_url).json() + return pr_data def generate_post_data(self, draft=False, prerelease=False): pr_number = self.find_relevant_pr() - pr_body = self.get_pr_body(pr_number) + pr_data = self.get_pr_data(pr_number) + pr_body = pr_data['body'] release_notes = self.extract_release_notes(pr_body) post_data = { 'tag_name': self.tag_name, diff --git a/autorelease/scripts/autorelease-release b/autorelease/scripts/autorelease-release index 024ccae..b223821 100644 --- a/autorelease/scripts/autorelease-release +++ b/autorelease/scripts/autorelease-release @@ -69,7 +69,12 @@ if __name__ == "__main__": repo=repo, github_user=github_user ) - + + # testing + expected_pr = releaser.find_relevant_pr() + print("Expected PR: " + str(expected_pr)) + print("PR issue: " + str(releaser.get_pr_data(expected_pr))) + print("POST DATA:") print(releaser.generate_post_data()) if not opts.dry: releaser.create_release()