diff --git a/.github/actions/prepare-telegram-issue-message/prepare.py b/.github/actions/prepare-telegram-issue-message/prepare.py index a983aa2..7946dfc 100644 --- a/.github/actions/prepare-telegram-issue-message/prepare.py +++ b/.github/actions/prepare-telegram-issue-message/prepare.py @@ -66,7 +66,7 @@ def format_closed(repository, issue, actor): f"*{escape_markdown(issue['title'])}*", escape_markdown(actor), ] - message = " · ".join(parts) + message = " • ".join(parts) if excerpt := body_excerpt(issue.get("body") or ""): message += f"\n{escape_markdown(excerpt)}" return message diff --git a/.github/actions/prepare-telegram-pr-message/prepare.py b/.github/actions/prepare-telegram-pr-message/prepare.py index bd7dc3a..5ffd9de 100644 --- a/.github/actions/prepare-telegram-pr-message/prepare.py +++ b/.github/actions/prepare-telegram-pr-message/prepare.py @@ -43,15 +43,15 @@ def format_opened(repository, pull_request, event_action): } event = events.get(event_action, "opened") return ( - f"*{escape_markdown(repository)}* · {pull_request_link(pull_request)} {event} · " - f"*{escape_markdown(pull_request['title'])}* · {escape_markdown(author_login(pull_request))}" + f"*{escape_markdown(repository)}* • {pull_request_link(pull_request)} {event} • " + f"*{escape_markdown(pull_request['title'])}* • {escape_markdown(author_login(pull_request))}" ) def format_merged(repository, pull_request): return ( - f"*{escape_markdown(repository)}* · {pull_request_link(pull_request)} merged · " - f"*{escape_markdown(pull_request['title'])}* · {escape_markdown(author_login(pull_request))}" + f"*{escape_markdown(repository)}* • {pull_request_link(pull_request)} merged • " + f"*{escape_markdown(pull_request['title'])}* • {escape_markdown(author_login(pull_request))}" ) @@ -66,13 +66,13 @@ def format_digest(repository, pull_requests, now=None): now = now or datetime.now(timezone.utc) count = len(pull_requests) - header = f"*{escape_markdown(repository)}* · {count} open {'PR' if count == 1 else 'PRs'}" + header = f"*{escape_markdown(repository)}* • {count} open {'PR' if count == 1 else 'PRs'}" lines = [] for pull_request in pull_requests[:DIGEST_PR_LIMIT]: age = max(0, (now - parse_github_time(pull_request["createdAt"])).days) line = ( - f"{pull_request_link(pull_request)} · *{escape_markdown(pull_request['title'])}* · " - f"{escape_markdown(author_login(pull_request))} · {age}d" + f"{pull_request_link(pull_request)} • *{escape_markdown(pull_request['title'])}* • " + f"{escape_markdown(author_login(pull_request))} • {age}d" ) remaining = len(pull_requests) - len(lines) - 1 suffix = ( diff --git a/.github/actions/prepare-telegram-release-message/prepare.py b/.github/actions/prepare-telegram-release-message/prepare.py index 3963d1d..5de4286 100644 --- a/.github/actions/prepare-telegram-release-message/prepare.py +++ b/.github/actions/prepare-telegram-release-message/prepare.py @@ -62,7 +62,7 @@ def format_published(repository, release): parts.append(f"*{escape_markdown(name)}*") parts.append(escape_markdown(release.get("actor") or "ghost")) - message = " · ".join(parts) + message = " • ".join(parts) if description := release_description(release.get("body") or "", tag=tag): message += f"\n{description}" return message diff --git a/test/test_telegram_notifications.py b/test/test_telegram_notifications.py index 278a266..0a6875a 100644 --- a/test/test_telegram_notifications.py +++ b/test/test_telegram_notifications.py @@ -39,8 +39,8 @@ def test_formats_opened_pull_request(self): self.assertEqual( message, - "*owner/repo* · [PR 42](https://github.com/owner/repo/pull/42) opened · " - "*feat: add notifications* · octocat", + "*owner/repo* • [PR 42](https://github.com/owner/repo/pull/42) opened • " + "*feat: add notifications* • octocat", ) def test_formats_ready_and_reopened_pull_request_actions(self): @@ -57,8 +57,8 @@ def test_formats_merged_pull_request(self): self.assertEqual( message, - "*owner/repo* · [PR 42](https://github.com/owner/repo/pull/42) merged · " - "*feat: add notifications* · octocat", + "*owner/repo* • [PR 42](https://github.com/owner/repo/pull/42) merged • " + "*feat: add notifications* • octocat", ) def test_escapes_pull_request_values_for_telegram_markdown(self): @@ -80,7 +80,7 @@ def test_open_pull_request_digest_excludes_drafts_and_reports_age(self): self.assertIn("1 open PR", message) self.assertTrue(message.startswith("*owner/repo*")) - self.assertIn("octocat · 2d", message) + self.assertIn("octocat • 2d", message) self.assertNotIn("#41", message) self.assertNotIn("more", message) @@ -101,8 +101,8 @@ def test_open_pull_request_digest_lists_at_most_ten_pull_requests(self): message = PR_TELEGRAM.format_digest("owner/repo", pull_requests) self.assertIn("12 open PRs", message) - self.assertIn("[PR 10](https://github.com/owner/repo/pull/10) · *feat: add notifications*", message) - self.assertNotIn("[PR 11](https://github.com/owner/repo/pull/11) · *feat: add notifications*", message) + self.assertIn("[PR 10](https://github.com/owner/repo/pull/10) • *feat: add notifications*", message) + self.assertNotIn("[PR 11](https://github.com/owner/repo/pull/11) • *feat: add notifications*", message) self.assertIn(r"[\.\.\.and 2 more](https://github.com/owner/repo/pulls)", message) def test_open_pull_request_digest_stays_within_telegram_limit(self): @@ -143,8 +143,8 @@ def test_closed_issue_includes_body(self): self.assertEqual( message, - "*owner/repo* · [issue 12](https://github.com/owner/repo/issues/12) closed · " - "*Move notifications* · octocat\nResolution summary\\.", + "*owner/repo* • [issue 12](https://github.com/owner/repo/issues/12) closed • " + "*Move notifications* • octocat\nResolution summary\\.", ) def test_closed_issue_truncates_long_body(self): @@ -203,8 +203,8 @@ def test_formats_release_without_repeating_tag_as_name(self): self.assertEqual( message, - "*owner/repo* · [release v1\\.2\\.3](https://github.com/owner/repo/releases/tag/v1.2.3) " - "published · octocat", + "*owner/repo* • [release v1\\.2\\.3](https://github.com/owner/repo/releases/tag/v1.2.3) " + "published • octocat", ) def test_formats_distinct_release_name_and_escapes_markdown(self):