Skip to content

feat(telegram): accept GitHub repo URLs in /linkrepo and /unlinkrepo - #18

Merged
TOMOKI977 merged 1 commit into
mainfrom
feat/linkrepo-accept-url
Sep 26, 2026
Merged

TOMOKI977 merged 1 commit into
mainfrom
feat/linkrepo-accept-url

Conversation

@TOMOKI977

Copy link
Copy Markdown
Contributor

Summary

/linkrepo and /unlinkrepo now accept a pasted GitHub URL as well as owner/repo. Before, pasting a link only returned the usage message.

  • New parseRepoReference in src/domain/github.ts reads github.com URLs with or without the scheme or www., with a trailing slash or .git, and with deeper paths such as /pull/17, a query or a fragment. It keeps only owner/repo and then applies the strict validation.
  • It rejects other hosts, including lookalikes such as evilgithub.com, and URLs with no repo segment.
  • Webhook payload parsing still uses the strict parseRepoFullName, so only chat input gets the lenient form.
  • The usage text now says <owner/repo or GitHub repo URL>.

Tests

  • New parseRepoReference domain cases, plus a case proving parseRepoFullName still rejects URLs.
  • /linkrepo and /unlinkrepo each have a new command test with a pasted URL.
  • Full suite: 344/344. tsc --noEmit is clean.

🤖 Generated with Claude Code

@TOMOKI977
TOMOKI977 merged commit 435e427 into main Sep 26, 2026
2 checks passed
@TOMOKI977
TOMOKI977 deleted the feat/linkrepo-accept-url branch September 26, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant