Skip to content

[docs] docs: remove redundant content from templating.md#21876

Merged
pelikhan merged 1 commit intomainfrom
docs/unbloat-templating-2d39b9b0f29fee15
Mar 20, 2026
Merged

[docs] docs: remove redundant content from templating.md#21876
pelikhan merged 1 commit intomainfrom
docs/unbloat-templating-2d39b9b0f29fee15

Conversation

@github-actions
Copy link
Contributor

File Improved

docs/src/content/docs/reference/templating.md

Bloat Removed

Three categories of redundancy in the Runtime Imports section were eliminated:

  1. 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.

  2. 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.

  3. Common Use Cases section — Two full workflow examples that duplicated content already present:

    • "Shared instructions from a file" repeated the Macro Syntax section example
    • "External content from URL with line range" combined the URL Imports and Line Range examples

Reduction

Metric Before After Reduction
Lines 247 204 43 lines (17%)
Net diff −47 deletions, +4 insertions

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. Both host.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:

🗜️ Compressed by Documentation Unbloat ·

  • expires on Mar 22, 2026, 12:11 AM UTC

- 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>
@github-actions github-actions bot added automation documentation Improvements or additions to documentation labels Mar 20, 2026
@pelikhan pelikhan marked this pull request as ready for review March 20, 2026 01:46
Copilot AI review requested due to automatic review settings March 20, 2026 01:46
@pelikhan pelikhan merged commit 800da4c into main Mar 20, 2026
1 check passed
@pelikhan pelikhan deleted the docs/unbloat-templating-2d39b9b0f29fee15 branch March 20, 2026 01:47
Copy link
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

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.
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

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):

Copilot uses AI. Check for mistakes.
Comment on lines +165 to +166
{{#runtime-import ../src/config.go}} # Error: Relative traversal outside .github
{{#runtime-import /etc/passwd}} # Error: Absolute path not allowed
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automation documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants