Skip to content

Commit

Permalink
Address part of #490. Name the hyperlink with more details
Browse files Browse the repository at this point in the history
* If we don't have a valid url, don't include the fragment
  • Loading branch information
Steven Moy committed Aug 5, 2023
1 parent d7f6304 commit 5fea957
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions iambic/plugins/v0_1_0/github/github.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,13 +205,13 @@ def format_proposed_changes(changes: dict) -> str:
{plan}
```
[Run]({run_url})
[Extended Plan Details]({run_url})
"""


def ensure_body_length_fits_github_spec(body: str, blob_html_url: str = None) -> str:
if len(body) > BODY_MAX_LENGTH:
body = TRUNCATED_WARNING + f"""[Run]({blob_html_url})"""
body = TRUNCATED_WARNING + f"""[Extended Plan Details]({blob_html_url})"""
return body


Expand Down Expand Up @@ -754,8 +754,12 @@ def _process_template_changes(
else:
rendered_content = "no changes detected"

run_link_fragment = ""
if html_url:
run_link_fragment = f"[Extended Plan Details]({html_url})"

rendered_content = (
f"""Reacting to `{op_name}`\n\n{rendered_content}\n\n [Run]({html_url})"""
f"""Reacting to `{op_name}`\n\n{rendered_content}\n\n {run_link_fragment}"""
)
if pull_request:
_post_render_content_as_pr_comment(
Expand Down

0 comments on commit 5fea957

Please sign in to comment.