-
Notifications
You must be signed in to change notification settings - Fork 374
docs: add reuse.md reusability guide and wire it into the agent dispatcher #29101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,298 @@ | ||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||
| description: Imports, shared components, import-schema, and gh aw add/update for GitHub Agentic Workflows | ||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| # Imports & Reusability | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Shared components eliminate duplication of tool configs, prompt instructions, MCP servers, and safe-output jobs across multiple workflows. Each consumer gets updates automatically when the shared file changes. | ||||||||||||||||||||||||
|
Comment on lines
+5
to
+7
|
||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| ## Merged Fields | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| Only these frontmatter fields are merged when a file is imported: | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| | Field | Merge behaviour | | ||||||||||||||||||||||||
| |---|---| | ||||||||||||||||||||||||
| | `tools:`, `mcp-servers:`, `safe-outputs:`, `network:`, `permissions:`, `runtimes:`, `services:`, `cache:`, `features:` | Deep-merged | | ||||||||||||||||||||||||
| | `env:` | Merged; duplicate keys → compile error | | ||||||||||||||||||||||||
| | `github-app:`, `on.github-app:` | First-wins across imports | | ||||||||||||||||||||||||
| | `steps:`, `pre-steps:`, `pre-agent-steps:`, `post-steps:` | Appended in import order | | ||||||||||||||||||||||||
| | Markdown body | Appended as prompt instructions | | ||||||||||||||||||||||||
|
|
||||||||||||||||||||||||
| All other fields (`on:`, `engine:`, `timeout-minutes:`, …) are ignored in imported files. | ||||||||||||||||||||||||
|
Comment on lines
+21
to
+23
|
||||||||||||||||||||||||
| | Markdown body | Appended as prompt instructions | | |
| All other fields (`on:`, `engine:`, `timeout-minutes:`, …) are ignored in imported files. | |
| | `checkout:` | Appended; main workflow takes precedence | | |
| | Markdown body | Appended as prompt instructions | | |
| Other non-merged fields such as `on:`, `engine:`, and `timeout-minutes:` are ignored in imported files. |
Copilot
AI
Apr 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This “Input types” table looks incomplete vs existing shared components and the compiler: import-schema supports object with optional properties: (one-level deep) and the repo already uses type: integer (e.g. .github/workflows/shared/repo-memory-standard.md). Please document integer (or recommend number and call out integer as accepted) and mention properties: for object schemas.
| | `number` | Integer or float | | |
| | `boolean` | `true` / `false` | | |
| | `choice` | Enumerated; must supply `options:` | | |
| | `array` | List of values | | |
| | `object` | Sub-fields via `${{ github.aw.import-inputs.<name>.<subkey> }}` | | |
| | `number` | Numeric value; use for integer or float inputs | | |
| | `integer` | Accepted for whole-number inputs | | |
| | `boolean` | `true` / `false` | | |
| | `choice` | Enumerated; must supply `options:` | | |
| | `array` | List of values | | |
| | `object` | Supports optional `properties:` schema definitions (one level deep); sub-fields are accessed via `${{ github.aw.import-inputs.<name>.<subkey> }}` | |
Copilot
AI
Apr 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this MCP server example, version: is not a supported mcp-servers.* key (container image tags should be part of the container: string, e.g. mcp/jira:latest). As written, this snippet won’t do what the guide implies for users who copy/paste it.
| container: "mcp/jira" | |
| version: "latest" | |
| container: "mcp/jira:latest" |
Copilot
AI
Apr 29, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The compile-time section currently implies that changes to imported shared files take effect without recompilation, but that’s only true for the imported Markdown body when using runtime imports. Changes to an imported file’s frontmatter (tools, safe-outputs, mcp-servers, etc.) require recompiling the consumer workflow so the merged config in the .lock.yml is updated.
| - Imports are resolved at **compile time**; the `.lock.yml` loads shared `.md` bodies at **runtime** — edits to shared files take effect on the next run without recompilation. | |
| - Imports are resolved at **compile time**; however, for non-inlined imports the `.lock.yml` loads imported shared `.md` **bodies** at **runtime**. As a result, edits to the imported Markdown body take effect on the next run without recompilation. | |
| - Changes to an imported file’s **frontmatter** (for example `tools:`, `mcp-servers:`, `safe-outputs:`, `env:`, `permissions:`, or other merged fields) **do** require recompilation so the merged config in the consumer’s `.lock.yml` is updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot optimize this file for agentic information density, unslop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 7e55bed — rewrote the file for agentic information density: collapsed the merged-fields table into one compact table, removed wordy intro/explanation prose before each pattern, stripped the separate "Minimal shared component" / "Mixed frontmatter" examples into the pattern code blocks, and tightened all section headers. File went from 464 → 298 lines while retaining all technical content.