Add integrations and prompt inputs for issue notifications#54
Add integrations and prompt inputs for issue notifications#54
Conversation
…eatures - Add 'integrations' and 'prompt' inputs to workflows for better customization. - Update 'issue_body' description to include new prompt functionality. - Implement integration handling in the main action logic to notify relevant integrations in issue creation. - Create a new job in the test workflow to demonstrate integration functionality. - Update dependencies in package-lock.json for improved stability and performance.
WalkthroughAdds two new inputs, integrations and prompt, exposed in action.yml and workflow_dispatch across workflows; forwards those inputs into the Doc Detective action and uses them during issue creation (integration accordion, $PROMPT) and to conditionally add an assignee for copilot. Changes
Sequence Diagram(s)sequenceDiagram
participant User as "User (workflow_dispatch)"
participant GH as "GitHub Actions Runner"
participant Action as "Doc Detective Action\n(index.js)"
participant Issue as "GitHub Issues API"
participant Ext as "External Integrations\n(doc-sentinel, claude, copilot)"
rect rgba(200,200,255,0.5)
User->>GH: trigger workflow with `integrations` & `prompt`
GH->>Action: start action with inputs (integrations, prompt, issue_body...)
end
rect rgba(200,255,200,0.5)
Action->>Action: parse `integrations`, build integrationsAccordion
Action->>Issue: create/update issue body (includes $RESULTS, $PROMPT, integrationsAccordion)
end
rect rgba(255,200,200,0.5)
Action->>Ext: forward prompt/details to requested integrations (if any)
Ext-->>Action: integration responses/notifications (async)
end
Action->>Issue: optionally assign `copilot-swe-agent` when copilot requested
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Adds new GitHub Action inputs to optionally notify external “integrations” when creating failure issues, and to pass a configurable prompt into both issue templates and integration triggers.
Changes:
- Add
integrations(comma-separated) andpromptinputs; append an “Integrations”<details>block to created issues. - Special-case
copilotintegration to auto-assign the issue tocopilot-swe-agent. - Update workflows to expose the new inputs and add a workflow job covering the new integrations behavior; refresh bundled deps (lockfile + dist).
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| package-lock.json | Dependency updates / lockfile refresh (incl. Octokit/tooling packages). |
| index.js | Implements parsing/validation of integrations, prompt handling, accordion generation, and Copilot auto-assignment. |
| dist/index.js | Re-bundled build output reflecting source + dependency updates. |
| action.yml | Documents and defines new integrations and prompt inputs; updates issue_body docs for $PROMPT. |
| .github/workflows/test.yml | Adds a new job to exercise “fail + create issue + integrations accordion” behavior. |
| .github/workflows/main.yml | Adds workflow_dispatch inputs/wiring for integrations and prompt. |
| .github/workflows/local.yml | Adds workflow_dispatch inputs/wiring for integrations and prompt. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
.github/workflows/local.yml (1)
45-48: Keeppromptdefault aligned with the action input default.
default: ''here overrides the action-level default and makes$PROMPTempty in manual runs unless users set it every time.Suggested update
prompt: description: prompt required: false - default: '' + default: 'Investigate the causes of the failures reported in this Doc Detective test output and suggest fixes'🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/local.yml around lines 45 - 48, The workflow currently overrides the action input "prompt" by setting prompt.default to an empty string, which makes $PROMPT empty for manual runs; change the "prompt" input in the workflow so it does not override the action-level default (remove the default: '' line) or set prompt.default to the same default value used by the action input, ensuring the "prompt" input and $PROMPT retain the intended action-level default..github/workflows/main.yml (1)
49-52: Align workflowpromptdefault withaction.yml.This empty default overrides the action’s built-in prompt default when dispatched via this workflow.
Suggested update
prompt: description: prompt required: false - default: '' + default: 'Investigate the causes of the failures reported in this Doc Detective test output and suggest fixes'🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/main.yml around lines 49 - 52, The workflow input 'prompt' is overriding the action's built-in default; update the workflow's inputs so 'prompt' does not set an empty default (either remove the default key for 'prompt' or match the default value defined in action.yml) to allow the action's own default to be used; locate the 'prompt' input in the workflow definition (the prompt: description/required/default block) and remove or change the default accordingly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/test.yml:
- Around line 48-66: The job fail-tests-with-integrations currently runs on
every pull_request and will create real issues because create_issue_on_fail:
true; restrict execution or issue creation by adding a guard: either add an if
condition on the job (fail-tests-with-integrations) to only run for safe events
(e.g., workflow_dispatch or pull_request actions like opened/reopened) using
github.event_name and github.event.action, or make create_issue_on_fail
conditional so it is false for routine pull_request synces; update references to
create_issue_on_fail, integrations, and the job name when implementing the
conditional to ensure only intended events open issues.
In `@index.js`:
- Around line 198-203: The issue: building the issue body uses
String.prototype.replace which only replaces the first occurrence, so multiple
occurrences of placeholders like $RUN_URL, $RESULTS, or $PROMPT in the template
won't be substituted; fix the assignment that computes the body (starting from
core.getInput("issue_body") and the chained .replace calls) to use replaceAll
for each placeholder substitution (replace "$RUN_URL" with runURL, "$RESULTS"
with the formatted results, and "$PROMPT" with prompt), then append
integrationsAccordion as before so all instances are replaced.
- Around line 205-208: The current logic appends "copilot-swe-agent" to
assigneesList (symbols: assigneesList, integrations) but doesn't handle the case
where that account is not assignable and causes a 422 from GitHub; change the
flow to (1) sanitize inputs by trimming and deduplicating assigneesList, (2)
before calling the issue creation API verify each assignee is assignable (use
the repo assignee check endpoint — e.g. GET
/repos/:owner/:repo/assignees/:assignee or the equivalent octokit method — and
remove any non-assignable users), and (3) additionally wrap the issue creation
call to catch a 422 response and on that error remove the failing assignee(s)
(filter out "copilot-swe-agent" or the returned invalid assignees) and retry
once so a single bad assignee cannot prevent issue creation.
---
Nitpick comments:
In @.github/workflows/local.yml:
- Around line 45-48: The workflow currently overrides the action input "prompt"
by setting prompt.default to an empty string, which makes $PROMPT empty for
manual runs; change the "prompt" input in the workflow so it does not override
the action-level default (remove the default: '' line) or set prompt.default to
the same default value used by the action input, ensuring the "prompt" input and
$PROMPT retain the intended action-level default.
In @.github/workflows/main.yml:
- Around line 49-52: The workflow input 'prompt' is overriding the action's
built-in default; update the workflow's inputs so 'prompt' does not set an empty
default (either remove the default key for 'prompt' or match the default value
defined in action.yml) to allow the action's own default to be used; locate the
'prompt' input in the workflow definition (the prompt:
description/required/default block) and remove or change the default
accordingly.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
dist/index.jsis excluded by!**/dist/**package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
.github/workflows/local.yml.github/workflows/main.yml.github/workflows/test.ymlaction.ymlindex.js
|
📝 Documentation updates detected! New suggestion: Document GitHub Action issue notifications and AI integrations Tip: Connect Jira, Linear, Confluence, and more in Integrations to enrich suggestion quality 🔗 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@action.yml`:
- Line 86: The example string describing the prompt for integrations contains an
extra trailing parenthesis in the text that makes the sample malformed; edit the
action.yml description where the example shows `@claude <prompt_value>")` (the
line referencing PROMPT / integrations) and remove the stray `)` so the example
reads correctly (e.g., `@claude <prompt_value>"` or better yet remove the stray
quote if needed) to produce a well-formed example in the `The prompt passed to
integrations.` sentence.
…olerance - Use replaceAll() for placeholder substitution in issue body templates - Sanitize labels and assignees with trim + filter(Boolean) - Add deduplication guard for copilot-swe-agent assignee - Retry issue creation without assignees on 422 validation errors - Guard fail-tests-with-integrations job to only run on workflow_dispatch - Remove empty prompt defaults from workflow_dispatch inputs - Fix typo in action.yml prompt description Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.github/workflows/local.yml (1)
69-70: Consider propagating other workflow inputs to the action.The new
integrationsandpromptinputs are correctly passed to the action. However, many otherworkflow_dispatchinputs (lines 10-40) likeworking_directory,input,create_pr_on_change,exit_on_fail,create_issue_on_fail, andissue_bodyare defined but not forwarded to the action step.This is a pre-existing pattern, but you may want to align the workflow to actually use all the dispatch inputs for a more useful manual-dispatch experience.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/local.yml around lines 69 - 70, The workflow step forwards only integrations and prompt to the action; update the action's step to propagate all defined workflow_dispatch inputs (e.g., working_directory, input, create_pr_on_change, exit_on_fail, create_issue_on_fail, issue_body, and any other inputs declared between lines 10-40) by adding them as key/value pairs like `<input_name>: ${{ github.event.inputs.<input_name> }}` alongside the existing integrations and prompt entries so the action receives all manual-dispatch parameters.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.github/workflows/local.yml:
- Around line 69-70: The workflow step forwards only integrations and prompt to
the action; update the action's step to propagate all defined workflow_dispatch
inputs (e.g., working_directory, input, create_pr_on_change, exit_on_fail,
create_issue_on_fail, issue_body, and any other inputs declared between lines
10-40) by adding them as key/value pairs like `<input_name>: ${{
github.event.inputs.<input_name> }}` alongside the existing integrations and
prompt entries so the action receives all manual-dispatch parameters.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
dist/index.jsis excluded by!**/dist/**
📒 Files selected for processing (5)
.github/workflows/local.yml.github/workflows/main.yml.github/workflows/test.ymlaction.ymlindex.js
🚧 Files skipped from review as they are similar to previous changes (2)
- .github/workflows/main.yml
- .github/workflows/test.yml
|
📝 Documentation updates detected! Updated existing suggestion: Document GitHub Action issue notifications and AI integrations Tip: Request one-off documentation tasks in the Dashboard under New Task 🚀 |
Summary
integrationsinput: comma-separated list of integrations (doc-sentinel, promptless, dosu, claude, opencode, copilot) to notify in created GitHub issues via a collapsible accordion sectionpromptinput: text passed to integrations and available as$PROMPTin issue body templatescopilotintegration auto-assigns the issue to Copilot instead of adding to the accordionSummary by CodeRabbit
New Features
Tests