Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions fern/pages/contribute/repos/github-action.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,45 @@ title: github-action
[`github-action`](https://github.com/doc-detective/github-action) runs Doc Detective in GitHub workflows. While Doc Detective can run in any CI/CD environment, this GitHub Action simplifies the process of running Doc Detective in GitHub workflows, provides a `results` object that can be used in subsequent steps, and offers handy features like creating GitHub issues for failed tests.

This repo depends on [`doc-detective`](doc-detective) for performing the tests.

## Issue notifications
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Citation: Based on changes in action.yml which defines the new integrations and prompt inputs, and index.js which implements parseIntegrations(), buildIntegrationsAccordion(), and the INTEGRATION_MAP constant with the supported integration values.
View source


The GitHub Action can automatically create GitHub issues when tests fail. Set `create_issue_on_fail` to `true` to enable this.

### Basic issue configuration

- `create_issue_on_fail`: Creates a GitHub issue when any test fails.
- `issue_title`: Title of the created issue. Default: `"Doc Detective Failure"`.
- `issue_body`: Body of the issue. Supports these variables:
- `$RUN_URL`: URL of the workflow run that created the issue.
- `$RESULTS`: Test results as a JSON code block.
- `$PROMPT`: The prompt text (see below).
- `issue_labels`: Comma-separated list of labels to apply.
- `issue_assignees`: Comma-separated list of GitHub usernames to assign.

### AI integrations

Notify AI-powered integrations when issues are created to help investigate and fix failures faster. Use `integrations` to specify which integrations to notify.

- `integrations`: Comma-separated list of integrations to notify. Supported values:
- `doc-sentinel`: Mentions @reem-sab
- `promptless`: Mentions @Promptless with the prompt
- `dosu`: Mentions @dosu with the prompt
- `claude`: Mentions @claude with the prompt
- `opencode`: Uses the `/opencode` command with the prompt
- `copilot`: Auto-assigns the issue to Copilot (instead of adding to the accordion)

Integrations (except `copilot`) appear in a collapsible "Integrations" section in the issue body. Invalid integration names are warned and ignored.

- `prompt`: Text passed to integrations, inserted where `$PROMPT` appears in integration mentions. You can also use `$PROMPT` in your custom `issue_body` template. Default: `"Investigate potential causes of the failures reported in this Doc Detective test output and suggest fixes."`.

### Example

```yaml
- uses: doc-detective/github-action@v1
with:
input: ./docs
create_issue_on_fail: true
integrations: claude,copilot
prompt: "Analyze these test failures and suggest documentation fixes"
```