def run(self, user, repo, pull_id): issue_id = int(pull_id) user = self._client.get_user(user) repo = user.get_repo(repo) pull = repo.get_pull(issue_id) result = pull_to_dict(pull=pull) return result
def run(self, user, repo, pull_id, message, event): user = self._client.get_user(user) repo = user.get_repo(repo) pull = repo.get_pull(pull_id) pull.create_review(commit=repo.get_commit(pull.merge_commit_sha), body=str(message), event=str(event)) result = pull_to_dict(pull) return result
def run(self, user, repo, filter=None, state=None, sort=None, direction=None, base=None, head=None, since=None, limit=20): user = self._client.get_user(user) repo = user.get_repo(repo) kwargs = {} if state: kwargs['state'] = state if sort: kwargs['sort'] = sort if direction: kwargs['direction'] = direction if base: kwargs['base'] = base if head: kwargs['head'] = head if filter: pattern = re.escape(filter['pattern']) # Note: PyGithub library introduces an abstraction for paginated lists # which doesn't conform to Python's iterator spec so we can't use # array slicing to exhaust the list :/ pulls = repo.get_pulls(**kwargs) pulls = list(pulls) result = [] for index, pull in enumerate(pulls): pull = pull_to_dict(pull=pull) if filter: if re.search(pattern, pull[filter['key']]): result.append(pull) if (index + 1) >= limit: break else: result.append(pull) if (index + 1) >= limit: break return result
def run(self, user, repo, title, head, base, body=None, maintainer_can_modify=None): user = self._client.get_user(user) repo = user.get_repo(repo) pull = repo.create_pull(title=title, head=head, base=base, body=body or '', maintainer_can_modify=maintainer_can_modify or GithubObject.NotSet) result = pull_to_dict(pull=pull) return result
def run(self, user, repo, title, body, head, base): user = self._client.get_user(user) repo = user.get_repo(repo) pull = repo.create_pull(title=title, body=body, head=head, base=base) result = pull_to_dict(pull=pull) return result