@frogbotai/piece-github connects an agent to GitHub issues and pull requests through a GitHub App. Mention the bot in a comment, and the agent replies in the same conversation. When the agent uses the question tool, it posts the question as a comment, and participants answer by commenting /answer.
Connect an agent
github. Give each instance its own slug when you connect more than one app.
auth takes either the three app fields or accessToken. See factory options for slug, auth, oauth, and scopes.
Channels need GitHub App credentials. A personal access token works for the piece’s actions, not for channels.
Create the GitHub App
- In your GitHub settings, create a GitHub App. Set Webhook URL to
https://your-app.example.com/api/webhooks/<instance>and set a Webhook secret. - Under Repository permissions, grant Issues: Read and write, Pull requests: Read and write, and Metadata: Read-only.
- Under Subscribe to events, select Issue comment and Pull request review comment.
- Generate a private key, then install the app on the repositories the agent should work in. The installation ID is the number at the end of the installation’s settings URL.
- To find
botUserId, openhttps://api.github.com/users/<app-slug>[bot]and copyid.
Where the bot replies
After its first reply, the bot follows the conversation and answers every new comment there without a mention. Each issue, pull request conversation, and review thread is its own conversation. The bot ignores edited and deleted comments.
Who can answer
FrogBot matches a commenter to a FrogBot user by the email address on their public GitHub profile. Most GitHub accounts don’t show an email, so most commenters arrive without a FrogBot user. The default agentaccess check requires a signed-in user and denies them. Write an access function for every agent that uses GitHub.
req.context.channel.author holds the GitHub user id and login as username. The example above admits a fixed list of user IDs; find a user’s ID at https://api.github.com/users/<login>. Prefer IDs to logins: a login can be renamed, and someone else can then claim it. To admit a repository’s collaborators instead, look up the commenter with the GitHub API in your access function.
Anyone who passes the check can answer, including a teammate who did not start the conversation. FrogBot records the GitHub login on the answer. Someone who fails the check and comments /answer or /dismiss while the question is open gets a short reply saying they don’t have access, and the question stays open. Their other comments are ignored.
What participants see
Each question is a comment in the conversation. It shows the header, the question, the options as a numbered list with their descriptions, and how to reply:
Commands are not case-sensitive, and extra spaces are ignored. A comment counts only when the command is the first thing in it: a comment that quotes a command, mentions the bot first, or wraps the command in backticks is ordinary discussion and reaches the agent. Every comment that doesn’t start with a command also reaches the agent, and it is handled after the question is answered.
When the agent asks several questions in one call, FrogBot posts them one comment at a time, each marked
Question 2 of 3. Answering one closes its comment and posts the next. When the agent makes several question calls in one step, their comments appear one after another.
When a question is answered, FrogBot edits its comment to show the answer and who answered, removes the reply instructions, and the agent continues in the same conversation. The first answer wins.
Questions are answered only in GitHub. The FrogBot admin chat shows the conversation read-only.
FrogBot escapes Markdown in the agent’s question text, so every character of an option appears as the agent wrote it (a line break inside an option becomes a space), and @ mentions and #123 or GH-123 issue references don’t notify anyone or link to an issue. Replies and closed questions show logins as code, so naming a participant doesn’t send a notification.