createWorkflowTemplate generates a concise workflow template with essential options
(workflowName string, engine string)
| 82 | |
| 83 | // createWorkflowTemplate generates a concise workflow template with essential options |
| 84 | func createWorkflowTemplate(workflowName string, engine string) string { |
| 85 | engineLine := "" |
| 86 | if engine != "" { |
| 87 | engineLine = "\n# AI engine to use for this workflow\nengine: " + engine + "\n" |
| 88 | } |
| 89 | return `--- |
| 90 | # Trigger - when should this workflow run? |
| 91 | on: |
| 92 | workflow_dispatch: # Manual trigger |
| 93 | |
| 94 | # Alternative triggers (uncomment to use): |
| 95 | # on: |
| 96 | # issues: |
| 97 | # types: [opened, reopened] |
| 98 | # pull_request: |
| 99 | # types: [opened, synchronize] |
| 100 | # schedule: daily # Fuzzy daily schedule (scattered execution time) |
| 101 | # # schedule: weekly on monday # Fuzzy weekly schedule |
| 102 | |
| 103 | # Permissions - what can this workflow access? |
| 104 | # Write operations (creating issues, PRs, comments, etc.) are handled |
| 105 | # automatically by the safe-outputs job with its own scoped permissions. |
| 106 | permissions: |
| 107 | contents: read |
| 108 | issues: read |
| 109 | pull-requests: read |
| 110 | ` + engineLine + ` |
| 111 | # Tools - GitHub API access via toolsets (context, repos, issues, pull_requests) |
| 112 | # tools: |
| 113 | # github: |
| 114 | # toolsets: [default] |
| 115 | |
| 116 | # Network access |
| 117 | network: defaults |
| 118 | |
| 119 | ` + buildSafeOutputsSection() + ` |
| 120 | --- |
| 121 | |
| 122 | # ` + workflowName + ` |
| 123 | |
| 124 | Describe what you want the AI to do when this workflow runs. |
| 125 | |
| 126 | ## Instructions |
| 127 | |
| 128 | Replace this section with specific instructions for the AI. For example: |
| 129 | |
| 130 | 1. Read the issue description and comments |
| 131 | 2. Analyze the request and gather relevant information |
| 132 | 3. Provide a helpful response or take appropriate action |
| 133 | |
| 134 | Be clear and specific about what the AI should accomplish. |
| 135 | |
| 136 | ## Notes |
| 137 | |
| 138 | - Run ` + "`" + string(constants.CLIExtensionPrefix) + " compile`" + ` to generate the GitHub Actions workflow |
| 139 | - See https://github.github.com/gh-aw/ for complete configuration options and tools documentation |
| 140 | ` |
| 141 | } |