[docs] docs: remove redundant content from templating.md#21876
Conversation
- Condense Runtime Imports intro (remove duplicate macro-supports list) - Simplify Path Validation section (remove valid-path examples already shown in Macro Syntax) - Remove Common Use Cases section (examples already covered in Macro Syntax and URL Imports sections) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Removes redundant content from the Runtime Imports section of the templating reference to reduce repetition and shorten the page.
Changes:
- Collapses the Runtime Imports introduction into a single paragraph.
- Removes duplicated “valid path” examples from Path Validation, keeping only invalid-path examples.
- Deletes the “Common Use Cases” section that duplicated earlier examples.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - URL fetching with automatic caching | ||
| - Content sanitization (front matter removal, macro detection) | ||
| - Automatic `.github/` prefix handling | ||
| Runtime imports include content from files and URLs in workflow prompts **at runtime** (unlike [compile-time imports](/gh-aw/reference/imports/)). File paths are restricted to the `.github` folder. Use `{{#runtime-import filepath}}` or `{{#runtime-import? filepath}}` for optional imports. |
There was a problem hiding this comment.
The intro states that runtime-import file paths are restricted to the .github folder, but the runtime implementation also supports importing from the top-level .agents/ directory and (for paths without an explicit prefix) resolves relative to .github/workflows rather than .github/. Consider updating this sentence to reflect the actual resolution rules (e.g., .github/workflows default + explicit .github/... and .agents/... support) so readers don’t form incorrect expectations.
See below for a potential fix:
Runtime imports include content from files and URLs in workflow prompts **at runtime** (unlike [compile-time imports](/gh-aw/reference/imports/)). For security, runtime file paths are resolved within your repository and may only target files under `.github/workflows` (default), explicitly-prefixed `.github/...` paths, or the top-level `.agents/` directory. Use `{{#runtime-import filepath}}` or `{{#runtime-import? filepath}}` for optional imports.
### Macro Syntax
Use `{{#runtime-import filepath}}` to include file content at runtime. Optional imports use `{{#runtime-import? filepath}}` which don't fail if the file is missing.
**Important:** By default, file paths are resolved relative to `.github/workflows`. You can also explicitly target files under `.github/` (using a `.github/...` path) or the top-level `.agents/` directory (using an `.agents/...` path):
| {{#runtime-import ../src/config.go}} # Error: Relative traversal outside .github | ||
| {{#runtime-import /etc/passwd}} # Error: Absolute path not allowed |
There was a problem hiding this comment.
The Path Validation example {{#runtime-import ../src/config.go}} may not actually be rejected by the runtime importer: with the current resolution logic, ../src/config.go can normalize to a path that still stays inside .github/ (e.g., resolving from .github/workflows up to .github/src/...). Use an example that reliably escapes .github (such as ../../src/config.go, or .github/../src/config.go) or reword the text to clarify that only paths that resolve outside .github are rejected.
File Improved
docs/src/content/docs/reference/templating.mdBloat Removed
Three categories of redundancy in the Runtime Imports section were eliminated:
Intro "macro supports" list — 4 bullet points listing features (line ranges, URL fetching, content sanitization,
.github/prefix handling) that are each fully explained in the subsections directly below.Path Validation code block — The valid-path examples (✅) in the Security Features section repeated the same examples already shown in the Macro Syntax section. Kept only the invalid-path (❌) examples since those aren't shown elsewhere.
Common Use Cases section — Two full workflow examples that duplicated content already present:
Reduction
Screenshots
Screenshots could not be captured during this run. The Playwright container (running with
--network host) cannot reach the agent container's bridge network (172.30.0.20:4321) due to network isolation. Bothhost.docker.internal(name not resolved) and direct bridge IP access (connection timed out) failed.Blocked Domains: N/A — server was not reachable from Playwright.
References: