Skip to content

docs: add slash command guidance for SideRepoOps pattern#25401

Merged
pelikhan merged 3 commits intomainfrom
copilot/add-guidance-slash-commands
Apr 8, 2026
Merged

docs: add slash command guidance for SideRepoOps pattern#25401
pelikhan merged 3 commits intomainfrom
copilot/add-guidance-slash-commands

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

The SideRepoOps pattern page and Command Triggers reference had no cross-references and no guidance on why slash_command: triggers are incompatible with SideRepoOps — leaving users to discover the GitHub Actions event-delivery constraint on their own.

Changes

patterns/side-repo-ops.mdx — new "Slash Commands" section:

  • Explains the root cause: GitHub only delivers events to workflows in the repo where the event occurred, so side-repo workflows never receive main-repo events
  • Documents the bridge pattern — a minimal relay workflow in the main repo that forwards the slash command to the side repo via workflow_dispatch:
main repo:  /review  →  [relay workflow]  →  workflow_dispatch
                                                     ↓
side repo:                               [AI worker workflow]
  • Trade-off table comparing three options: slash command in main repo, bridge pattern, scheduled polling

reference/command-triggers.md — new "Slash Commands in SideRepoOps" section:

  • Concise callout at the point of discovery, linking to the full walkthrough in the pattern page

Related links updated in both files to cross-reference each other and the ChatOps pattern.

- Add "Slash Commands" section to side-repo-ops.mdx explaining why
  slash_command triggers cannot be used directly in SideRepoOps, the
  recommended relay/bridge pattern, and trade-offs between approaches
- Add "Slash Commands in SideRepoOps" callout to command-triggers.md
  with a concise explanation and link to the full guidance
- Update Related links in both files to cross-reference each other and
  ChatOps pattern page

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/ce0c2c78-d96c-44db-a310-4a35c7e3cc4b

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add documentation for using slash commands in SideRepoOps docs: add slash command guidance for SideRepoOps pattern Apr 8, 2026
Copilot AI requested a review from pelikhan April 8, 2026 22:21
@pelikhan pelikhan marked this pull request as ready for review April 8, 2026 22:22
Copilot AI review requested due to automatic review settings April 8, 2026 22:22
@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Apr 8, 2026

@copilot review updates for accuracy, clarity. Use unbloat agent

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds documentation guidance clarifying why slash_command: triggers don’t work in the SideRepoOps pattern, and introduces a recommended “bridge/relay” approach with cross-references between the SideRepoOps pattern page and the Command Triggers reference.

Changes:

  • Adds a “Slash Commands” section to the SideRepoOps pattern page explaining the GitHub Actions event-delivery constraint and a relay/bridge approach.
  • Adds a “Slash Commands in SideRepoOps” section to the Command Triggers reference, linking to the full pattern walkthrough.
  • Updates related-links sections to cross-reference SideRepoOps, ChatOps, and Command Triggers.
Show a summary per file
File Description
docs/src/content/docs/reference/command-triggers.md Adds a discovery-time callout explaining SideRepoOps incompatibility and links to the pattern walkthrough.
docs/src/content/docs/patterns/side-repo-ops.mdx Adds a detailed “Slash Commands” section with a proposed bridge pattern and trade-off table; updates related links.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 2

Comment on lines +353 to +359
workflow-dispatch:
target-repo: "my-org/automation-repo"
workflow: "review.md"
inputs:
source_repo: "my-org/main-repo"
pr_number: "${{ github.event.issue.number }}"
comment_body: "${{ steps.sanitized.outputs.text }}"
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The relay workflow example uses safe-outputs.workflow-dispatch, but the supported safe output type is dispatch-workflow (see docs/src/content/docs/reference/safe-outputs.md “Workflow Dispatch (dispatch-workflow:)”). As written, this frontmatter won’t compile/work because workflow-dispatch (and the workflow: "review.md" field) aren’t recognized; dispatch-workflow expects a workflows: [...] allowlist (workflow names without the .md extension) plus optional target-repo/target-ref for cross-repo dispatch. Also note that dispatch inputs are provided by the agent when invoking the generated dispatch tool, not via a static inputs: map in the safe-outputs config.

Suggested change
workflow-dispatch:
target-repo: "my-org/automation-repo"
workflow: "review.md"
inputs:
source_repo: "my-org/main-repo"
pr_number: "${{ github.event.issue.number }}"
comment_body: "${{ steps.sanitized.outputs.text }}"
dispatch-workflow:
target-repo: "my-org/automation-repo"
workflows: ["review"]

Copilot uses AI. Check for mistakes.
workflow: "review.md"
inputs:
source_repo: "my-org/main-repo"
pr_number: "${{ github.event.issue.number }}"
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

In the relay example, pr_number is set to github.event.issue.number, but on: /review defaults to multiple slash command event contexts (including pull_request / pull_request_review_comment) where github.event.issue.number is not present. Either restrict slash_command.events to contexts that guarantee issue.number (e.g., pull_request_comment only), or use a fallback expression that also handles PR events (e.g., github.event.pull_request.number).

Suggested change
pr_number: "${{ github.event.issue.number }}"
pr_number: "${{ github.event.issue.number || github.event.pull_request.number }}"

Copilot uses AI. Check for mistakes.
- Remove redundant NOTE callout (constraint already stated in prose)
- Remove closing sentence after code examples (self-evident)
- Remove "When to choose" bullet list (duplicates trade-offs table)
- Tighten command-triggers.md callout paragraph
- Remove redundant parenthetical from Related Documentation link

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/6f87cdf1-4787-497c-82bf-774a0a2eeebe

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Apr 8, 2026

@copilot review updates for accuracy, clarity. Use unbloat agent

Done in f774f68. Removed: the NOTE callout (constraint already stated in the preceding sentence), the closing sentence after the code examples (self-evident), and the "When to choose each approach" bullet list (duplicate of the trade-offs table). Also tightened the callout paragraph in command-triggers.md and cleaned up the Related Documentation entry.

Copilot AI requested a review from pelikhan April 8, 2026 22:30
@pelikhan pelikhan merged commit 8e4279f into main Apr 8, 2026
@pelikhan pelikhan deleted the copilot/add-guidance-slash-commands branch April 8, 2026 22:47
github-actions bot added a commit that referenced this pull request Apr 9, 2026
Added Bridge Pattern as a new glossary entry under Advanced Features.
This term was introduced in the slash command guidance for SideRepoOps
(PR #25401) and describes the relay workflow architecture for
cross-repository event forwarding.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs: No guidance on using slash commands in SideRepoOps pattern

3 participants