Skip to content

Commit 62df0b4

Browse files
authored
Allow TagBot to handle Copilot PRs (#408)
1 parent b5faf61 commit 62df0b4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

tagbot/action/changelog.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,15 @@ def _custom_release_notes(self, version_tag: str) -> Optional[str]:
183183
def _format_user(self, user: Optional[NamedUser]) -> Dict[str, object]:
184184
"""Format a user for the template."""
185185
if user:
186+
# Fetching `user.name` for the Copilot bot fails, so it needs to be
187+
# special-cased.
188+
name = (
189+
"Copilot"
190+
if (user.login == "Copilot" and user.type == "Bot")
191+
else (user.name or user.login)
192+
)
186193
return {
187-
"name": user.name or user.login,
194+
"name": name,
188195
"url": user.html_url,
189196
"username": user.login,
190197
}

0 commit comments

Comments
 (0)