Jido Chat GitHub
jido_chat_github adapts GitHub Issues and issue comments to the Jido.Chat.Adapter contract.
Installation
def deps do
[
{:jido_chat_github, "~> 0.1"}
]
endFeature surface
-
Repositories map to channel-level rooms as
owner/repo. -
Issues map to threads as
owner/repo#issue_number. - Issue comments map to thread messages.
post_channel_message/3creates an issue.send_message/3,post_message/3,edit_message/4, anddelete_message/3manage issue comments.fetch_channel_messages/2andlist_threads/2list repository issues, excluding pull requests.fetch_thread/2,open_thread/3,fetch_message/3, andfetch_messages/2read issue and comment history.add_reaction/4andremove_reaction/4support GitHub issue and issue-comment reactions.-
Webhooks verify
X-Hub-Signature-256and parseissues,issue_comment, andreactionevents.
GitHub does not accept arbitrary binary uploads through the Issues comments API. Media support is implemented with GitHub Markdown links: remote image URLs render as images, and remote file/audio/video URLs render as links. Local file paths and in-memory uploads should be uploaded elsewhere first, then sent as public or GitHub-accessible URLs.
Replies are represented as quoted Markdown context because GitHub issue comments do not have native nested replies. Pass reply_to_id, reply_to_text, and optionally reply_author when sending a comment.
Live testing
Create or choose a disposable issue, then set:
RUN_LIVE_GITHUB_TESTS=true
GITHUB_TOKEN=github_pat_or_app_installation_token
GITHUB_TEST_ISSUE=owner/repo#123
GITHUB_WEBHOOK_SECRET=shared-webhook-secret
The token needs Issues: write on the target repository. If testing against pull request comments through the shared Issues comments API, also grant Pull requests: write.
Run:
mix test --include liveWebhook setup
Configure a GitHub App webhook, organization webhook, or repository webhook:
-
Payload URL: your runtime route for GitHub, for example
/api/webhooks/github -
Content type:
application/json -
Secret:
GITHUB_WEBHOOK_SECRET -
Events:
Issues,Issue comments,Reactions
The adapter treats owner/repo#issue_number as the external room id for issue-thread events.