Skip to content

Commit

Permalink
Merge pull request #1043 from googlefonts/packager-title
Browse files Browse the repository at this point in the history
packager: update pr title when updating a pr
  • Loading branch information
m4rc1e authored Oct 11, 2024
2 parents 4d6bab2 + 6741824 commit 5472688
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Lib/gftools/gfgithub.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ def create_pr(
},
)

def update_pr(
self, pull_number: int, title: str = None, body: str = None, state: str = None
):
return self._post(
self.rest_url(f"pulls/{pull_number}"),
{"title": title, "body": body, "state": state},
)

def create_issue_comment(self, issue_number: int, body: str):
return self._post(
self.rest_url(f"issues/{issue_number}/comments"), {"body": body}
Expand Down
1 change: 1 addition & 0 deletions Lib/gftools/packager/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,7 @@ def pr_family(
google_fonts.add_labels(open_prs[0]["number"], ["I New Font"])
else:
resp = google_fonts.create_issue_comment(open_prs[0]["number"], "Updated")
google_fonts.update_pr(open_prs[0]["number"], title=title)
log.info(f"Updated PR '{resp['html_url']}'")

# inherit labels from issue
Expand Down

0 comments on commit 5472688

Please sign in to comment.