AI issue mentions
When tests fail in CI, the Doc Detective GitHub Action can open or update an issue with a summary of the run. It can also mention AI assistants in that issue, so they investigate the failures and suggest fixes.
issue_mentions and issue_prompt are inputs of the GitHub Action. They’re unrelated to the integrations key in your Doc Detective config, which connects to services such as Heretto. For that key, see Integrations options.
Before you begin
- A workflow that runs
doc-detective/github-action@v2on Node.js 24.15 or later, which the example sets up withactions/setup-node. See Run in CI with the GitHub Action. - Each assistant you plan to mention, set up for the repository. See Supported assistants.
Mention an assistant
- Set
create_issue_on_failtotrue, and give the job theissues: writepermission. - List the assistants in
issue_mentions, separated by commas.
The workflow runs on pushes to main. By default, a fork’s pull request gets a read-only GITHUB_TOKEN and no secrets, so the action can’t open an issue for it. The token input matters for claude, which answers from a workflow. GitHub doesn’t start workflows for an issue that the default GITHUB_TOKEN opens. To create the token, see Hand off test failures to an AI agent.
When a test fails, the action opens an issue, which by default holds the run’s Markdown summary. If an open issue already has the same title and first label, the action updates that issue instead. See File an issue when tests fail. The action adds a collapsible section to the issue body that mentions each assistant, followed by the issue_prompt text. For copilot, the action assigns the issue to Copilot instead of adding a text mention.
Customize the prompt
issue_prompt sets the text that follows each mention. Write it to ask for the analysis you want:
To place the prompt somewhere else in the issue, put $PROMPT in issue_body. For prompt-writing patterns, see Hand off test failures to an AI agent.
Inputs
Both inputs take effect only when create_issue_on_fail is true.
Renamed inputs
GitHub Action @v2 renames two inputs. The old names still work as deprecated aliases:
When a workflow sets an old name, the action logs a warning that names the new one. When a workflow sets both names, the job fails before tests run. Rename the inputs in your workflow to clear the warning.
Supported assistants
Verify it works
Push a change that makes a test fail, then open the issue the action creates:
- The collapsible section mentions each assistant you listed, followed by your prompt.
- With
copilotlisted, Copilot is an assignee. - The job log shows no deprecation warning.
What’s next
- Run in CI with the GitHub Action for every issue and pull request input.
- Hand off test failures to an AI agent to turn failure issues into suggested fixes.