Skip to content

Commit

Permalink
fix(deployer): avoid GitHub mentions (#12429)
Browse files Browse the repository at this point in the history
* fix(deployer): avoid GitHub mentions

`redirect.github.com` is also used by Dependabot for the same purpose.

* fix(deployer): keep original url as link text

* style(black): run `black deployer/src`
  • Loading branch information
caugner authored Feb 3, 2025
1 parent 834e4a0 commit fa24e84
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion deployer/src/deployer/analyze_pr.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,15 @@ def post_about_dangerous_content(
external_urls_list = []
for url in sorted(external_urls):
count = external_urls[url]
# Avoid GitHub mentions.
original_url = url
url = url.replace("https://github.com/", "https://redirect.github.com/")
link = (
f"<{url}>" if url == original_url else f"[{original_url}](<{url}>)"
)
line = (
f" - {'🚨 ' if url.startswith('http://') else ''}"
f"<{url}> ({count} time{'' if count==1 else 's'})"
f"{link} ({count} time{'' if count == 1 else 's'})"
)
if diff_lines:
# If this was available and it _did_ fine a URL, then
Expand Down

0 comments on commit fa24e84

Please sign in to comment.