@mushi-mushi/plugin-github-issues
v0.1.3
Published
Mushi Mushi plugin for GitHub Issues — creates issues for classified reports and closes them when Mushi applies a fix.
Downloads
232
Maintainers
Readme
@mushi-mushi/plugin-github-issues
Mushi Mushi plugin: open a GitHub Issue (with a mushi-bug label) for every
classified bug report and close it automatically when Mushi applies a fix.
Install
npm i @mushi-mushi/plugin-github-issuesRun as a stand-alone server
MUSHI_PLUGIN_SECRET=... # set when the plugin is installed in Mushi admin
GITHUB_TOKEN=... # PAT or App installation token (issues:write, metadata:read)
GITHUB_OWNER=acme # repo owner (user or org)
GITHUB_REPO=widget-app # repo name
ADMIN_BASE_URL=https://... # Mushi admin base URL (deep-links)
PORT=3000 # optional
npx mushi-plugin-github-issuesInstall GitHub Issues in the Mushi admin Marketplace and point its
webhook_url at https://your-host/mushi/webhook.
Programmatic usage
import { createGithubIssuesPlugin } from '@mushi-mushi/plugin-github-issues'
import express from 'express'
import { expressMiddleware } from '@mushi-mushi/plugin-sdk'
const handler = createGithubIssuesPlugin({
token: process.env.GITHUB_TOKEN!,
owner: process.env.GITHUB_OWNER!,
repo: process.env.GITHUB_REPO!,
adminBaseUrl: process.env.ADMIN_BASE_URL!,
mushiSecret: process.env.MUSHI_PLUGIN_SECRET!,
})
express().post('/mushi/webhook', expressMiddleware(handler)).listen(3000)Subscribed events
report.classified→POST /repos/{owner}/{repo}/issues(creates themushi-buglabel idempotently if missing).fix.applied→PATCH /repos/{owner}/{repo}/issues/{number}withstate: closed.
Notes
- Default issue-number cache is in-memory; persist mappings in
report_external_issuesfor durability across restarts. - All GitHub API calls retry transient failures via
withRetryfrom@mushi-mushi/plugin-sdk.
License
MIT
