Add comprehensive poem-bot agentic workflow with all features#1242
Add comprehensive poem-bot agentic workflow with all features#1242
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
.github/workflows/poem-bot.md
Outdated
| # Workflow dispatch with label names input | ||
| workflow_dispatch: | ||
| inputs: | ||
| label_names: |
There was a problem hiding this comment.
There was a problem hiding this comment.
Removed label_names input from workflow_dispatch. Commit: e4d7c3a
.github/workflows/poem-bot.md
Outdated
|
|
||
| # AI engine configuration | ||
| engine: | ||
| id: claude |
There was a problem hiding this comment.
There was a problem hiding this comment.
Changed engine to copilot with gpt-5 model (removed max-turns as it's not supported by copilot). Commit: e4d7c3a
…ot/gpt-5, add upload-assets, use template conditionals Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
.github/workflows/poem-bot.md
Outdated
| - **Repository**: ${{ github.repository }} | ||
| - **Actor**: ${{ github.actor }} | ||
| - **Theme**: ${{ github.event.inputs.poem_theme }} | ||
| {{#if github.event.inputs.label_names}} |
There was a problem hiding this comment.
@copilot The expression must be a github action expression
{{#if ${{ github... }} }}
- update instructions.md accordingly
There was a problem hiding this comment.
Fixed template conditional syntax to {{#if ${{ github.event.inputs.label_names }}}} and added comprehensive documentation to instructions.md explaining the syntax, how it works, truthy/falsy values, examples, and best practices. Commit: 9a8f2d1
… add documentation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pkg/cli/templates/instructions.md
Outdated
|
|
||
| **Important**: The expression inside `{{#if}}` must be a complete GitHub Actions expression with `${{ }}` syntax. The workflow engine evaluates the `${{ }}` expression first, then processes the `{{#if}}` conditional based on the result. | ||
|
|
||
| ### How It Works |
There was a problem hiding this comment.
@copilot remove the rest of the changes in this file
There was a problem hiding this comment.
Removed Template Conditionals documentation from both instructions.md files. The workflow still uses the correct template syntax. Commit: fd8a6c2
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Overview
This PR adds a new
poem-botagentic workflow that demonstrates all available features in the GitHub Agentic Workflows system, including custom triggers, comprehensive safe-outputs configuration, cache-memory, network isolation, role-based access control, and template conditionals.Features
Custom Triggers
The workflow supports multiple trigger mechanisms:
/poem-botmentions in issues only (with events filter)poem_theme: Theme for the poem generationComprehensive Safe-Outputs (Staged Mode)
All 9 safe-output types are configured with
staged: truefor safe testing:[🎭 POEM-BOT])[🎨 POETRY])Security & Configuration
adminandmaintaineronlynetwork: {}) prevents external accessCreative AI Prompt
The workflow instructs the AI to:
Template Conditionals
The workflow uses template regions to conditionally render content based on workflow inputs, demonstrating the
{{#if ${{ expression }}}}conditional syntax for dynamic prompt generation. The template system evaluates GitHub Actions expressions first, then processes conditional blocks to include or exclude prompt content based on runtime values.Usage
Users with admin or maintainer permissions can trigger the workflow by:
/poem-boton any issueThe bot will generate original poems and use safe-outputs to create issues, add comments, apply labels, upload assets, and create pull requests as appropriate.
Files Added/Modified
.github/workflows/poem-bot.md(146 lines) - Source workflow definition.github/workflows/poem-bot.lock.yml(compiled) - Compiled GitHub Actions workflowTesting
This workflow serves as a comprehensive example of the agentic workflow system's capabilities, including template conditionals for dynamic prompt generation, while providing a creative and fun use case for automated poetry generation.
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.