Conversation
- Create wrapExpressionsInTemplateConditionals function to detect and wrap GitHub expressions in {{#if}} blocks
- Add shouldWrapExpression helper to identify expressions that need wrapping
- Integrate wrapping into compilation process before prompt generation
- Add comprehensive tests for expression wrapping functionality
- Update existing template rendering test to verify wrapped expressions
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
- Add end-to-end integration test for real-world workflow compilation - Add test for already-wrapped expressions to prevent double-wrapping - Add test for mixed expressions and literals - Verify correct wrapping behavior in compiled output - All tests passing Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix template expression handling in prompts
Add automatic expression wrapping for template conditionals in agentic workflows
Oct 5, 2025
Contributor
|
@copilot make it simpler: always wrap expressions that don't start with ${{ in {{#if |
…th ${{
- Remove shouldWrapExpression function and complex prefix checking
- Always wrap any expression in {{#if ...}} that doesn't start with ${{
- Simpler logic: just check if expression starts with "${{" to avoid double-wrapping
- Update all tests to reflect new behavior where literals are also wrapped
- Remove constants import that is no longer needed
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Done! Simplified to always wrap expressions that don't start with The new logic is much cleaner:
|
…c workflows Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
|
@copilot update docs and instructions |
- Add "Automatic Expression Wrapping" section to template-rendering.md
- Update all examples to show natural syntax without manual ${{ }} wrapping
- Add "Template Rendering" section to github-agentic-workflows.instructions.md
- Include examples of event-based conditionals and workflow inputs
- Document when to use manual wrapping for complex expressions
- Update compilation process docs to mention expression wrapping
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Contributor
Author
Done! Updated documentation and instructions in commit d9ab8e7. Documentation updates:
|
- Add comprehensive "Template Rendering" section with automatic wrapping details - Include event-based conditional examples - Document workflow input conditionals - Explain complex expression handling - Add truthy/falsy evaluation rules - Update compilation process to mention template expression wrapping Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Successfully implemented and documented automatic expression wrapping for template conditionals in agentic workflows.
Complete Documentation Updates
Both user-facing documentation and internal instructions now fully document the feature:
Template Rendering Docs (
docs/src/content/docs/reference/template-rendering.md):Instructions File (
.github/instructions/github-agentic-workflows.instructions.md):Implementation Summary
Simplified approach: Always wrap expressions in
{{#if}}that don't start with${{Examples:
{{#if github.event.issue.number}} → {{#if ${{ github.event.issue.number }} }} {{#if true}} → {{#if ${{ true }} }} {{#if ${{ github.actor }} }} → {{#if ${{ github.actor }} }} (no change)All tests passing. Documentation comprehensive and ready for users.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.