Skip to content

Commit

Permalink
Add: Print GitHub doc URL if available in conventional commits (#700)
Browse files Browse the repository at this point in the history
Would be nice to move this also into pontos.
  • Loading branch information
bjoernricks committed Jul 7, 2023
1 parent ba6e456 commit 249e0f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion conventional-commits/action/commits.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ async def run(self) -> int:
try:
json = e.response.json()
message = json.get("message")
# some response have links to the docs
doc_url = json.get("documentation_url", "")
except JSONDecodeError:
message = None

Expand All @@ -149,7 +151,7 @@ async def run(self) -> int:
"Could not create Pull Request comment. A HTTP "
f"{e.response.status_code} error occurred while doing "
f"a {e.request.method} request to {e.request.url}. "
f"Error was {message}"
f"Error was '{message}'. {doc_url}"
) from e
else:
raise CommitsError(
Expand Down

0 comments on commit 249e0f7

Please sign in to comment.