Conversation
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/da436940-6361-4301-89d1-3307f813ee7b Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…ctions files Agent-Logs-Url: https://github.com/github/gh-aw/sessions/da436940-6361-4301-89d1-3307f813ee7b Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Documents the workflow prompt templating conditionals ({{#if}} / {{#else}} / {{#endif}}) and updates experiment documentation/examples to match the newer tag forms.
Changes:
- Added a “Prompt Template Conditionals (
{{#if}})" section to clarify conditional syntax, supported operators, and usage notes. - Updated
.github/aw/experiments.mdexamples to use{{#else}}and{{#endif}}. - Updated the experiment spec JSON shape in the daily attribution workflow lock file.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/daily-community-attribution.lock.yml |
Updates GH_AW_EXPERIMENT_SPEC to the newer { variants: [...] } schema form. |
.github/aw/github-agentic-workflows.md |
Adds documentation for conditional template syntax and behavior. |
.github/aw/experiments.md |
Refreshes examples to the new {{#else}} / {{#endif}} tag forms. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comments suppressed due to low confidence (1)
.github/aw/github-agentic-workflows.md:2197
- The “Notes” bullets conflict: you state tags in fenced code blocks are preserved verbatim, but then say template tags are not visible to the agent and are stripped. Also, nested conditionals are not reliably treated as literal text by the current regex-based renderer (behavior is effectively undefined). Suggest clarifying that tags are stripped only for supported, well-formed conditionals outside fenced code blocks, and that nested conditionals are unsupported/undefined (may render incorrectly or leak tags).
- **Fenced code blocks are preserved** — `{{#if}}` tags inside `` ``` `` blocks are never processed; they appear verbatim in the output.
- **Nested conditionals are not supported** — do not place `{{#if}}` inside another `{{#if}}` block; the inner tags will be treated as literal text and appear verbatim in the agent prompt.
- **Template tags are not visible to the agent** — all `{{#if}}` / `{{#else}}` / `{{#endif}}` tags are stripped from the prompt before the agent runs.
- Files reviewed: 3/3 changed files
- Comments generated: 2
|
|
||
| | Form | Example | Truthy when | | ||
| |---|---|---| | ||
| | Bare value | `{{#if experiments.flag }}` | value is non-empty and not `"false"` | |
There was a problem hiding this comment.
The truthiness semantics for the “Bare value” condition look incomplete/inaccurate vs the implementation in actions/setup/js/is_truthy.cjs: it treats (case-insensitive) "", "false", "no", "0", "null", and "undefined" as falsy. The docs currently only call out empty + "false", which could lead authors to accidentally keep blocks for values like 0/no/null.
| | Bare value | `{{#if experiments.flag }}` | value is non-empty and not `"false"` | | |
| | Bare value | `{{#if experiments.flag }}` | value is not empty and is not any of `"false"`, `"no"`, `"0"`, `"null"`, or `"undefined"` (case-insensitive) | |
|
|
||
| ## Prompt Template Conditionals (`{{#if}}`) | ||
|
|
||
| The workflow markdown body supports a lightweight template language for conditional blocks. Template tags are resolved **at runtime, before the agent receives the prompt** — the agent always sees the final resolved text. |
There was a problem hiding this comment.
This section says template tags are resolved at runtime and the agent “always sees the final resolved text”. In practice, renderMarkdownTemplate only removes tags for well‑formed supported patterns; malformed blocks (e.g., missing closing tag) are left unchanged, and tags inside fenced code blocks are intentionally preserved. Consider softening the wording to avoid implying tags can never reach the agent.
This issue also appears on line 2195 of the same file.
| The workflow markdown body supports a lightweight template language for conditional blocks. Template tags are resolved **at runtime, before the agent receives the prompt** — the agent always sees the final resolved text. | |
| The workflow markdown body supports a lightweight template language for conditional blocks. Supported template tags are resolved **at runtime, before the agent receives the prompt**, so the agent typically sees the rendered result; malformed tags or tags in preserved contexts may remain unchanged. |
Summary
Ensures the
{{#if}}template conditional syntax is clearly documented for the model, prompted by the additions in #29620 which introduced{{#else}}/{{#endif}}support.Changes
github-agentic-workflows.mdAdded a new "Prompt Template Conditionals (
{{#if}})" section (after the "GitHub Context Expression Interpolation" section) covering:{{#if}}/{{#else}}/{{#endif}}){{#endif}}is the primary/preferred closing tag and{{/if}}is permanently supported as an alternate==, inequality!=, strict equality===/!==){{#else}})experiments.mdexperiments.mdUpdated all code examples to use:
{{#else}}instead of{{else}}{{#endif}}instead of{{/if}}(the primary closing form)