GitHub Models in Actions Migration Assessment
This document assesses the feasibility and opportunities for migrating from the current Copilot CLI-based automation to GitHub Models in Actions (actions/ai-inference).
Executive Summary
Recommendation: The repository should adopt a hybrid approach - keeping the current Copilot CLI for complex agentic workflows while adopting actions/ai-inference for simpler, focused AI tasks.
Key Findings
actions/ai-inferenceis ideal for simple, single-prompt AI tasks (e.g., text classification, summarization, structured extraction)- Copilot CLI excels at complex, multi-step agentic workflows (e.g., issue triage with code search, automated PR creation)
- Both approaches can coexist in the same repository
- Migration should be incremental, starting with low-risk workflows
Current Architecture
The repository uses GitHub Copilot CLI via the copilot-exec composite action for AI automation:
Current Stack
1 | ┌──────────────────────────────────────────────────┐ |
Current Capabilities
| Feature | Current Implementation |
|---|---|
| Prompt Templates | Plain text with ${} variable substitution |
| Model Context Protocol | GitHub MCP, Playwright MCP, Screeps MCP |
| Tool Calling | Full access to MCP tools (create issues, PRs, search code) |
| Multi-Step Reasoning | Supports complex agentic workflows |
| Caching | SHA256-based result caching |
| Model Selection | Configurable via input or env var |
GitHub Models in Actions (actions/ai-inference)
GitHub Models in Actions provides a simpler, more direct way to call AI models from GitHub Actions workflows.
Key Features
1 | # Simple inline prompt |
Required Permissions
1 | permissions: |
Prompt File Format (.prompt.yml)
1 | messages: |
Comparison: Copilot CLI vs. GitHub Models in Actions
| Aspect | Copilot CLI (Current) | GitHub Models (actions/ai-inference) |
|---|---|---|
| Complexity | High - full agent with tools | Low - single prompt/response |
| Tool Access | MCP servers (GitHub, Playwright, etc.) | None - AI response only |
| Multi-Step | Yes - complex reasoning chains | No - single request/response |
| Structured Output | Text-based | Native JSON schema support |
| Setup | Requires @github/copilot npm install |
First-party action, no setup |
| Permissions | Standard GitHub token | Requires models: read |
| Caching | Custom implementation | Not built-in |
| Variable Substitution | envsubst ($VAR or ${VAR}) |
Template syntax ({{var}}) |
| Model Selection | Flexible, env-based | Prompt file or action input |
| Best For | Complex agentic automation | Simple AI classification/extraction |
Migration Opportunities
Workflows Suitable for actions/ai-inference
These workflows could benefit from migration to GitHub Models:
1. Simple Classification Tasks (NEW OPPORTUNITY)
1 | # Example: Auto-label issues by type |
2. Simple Summarization (NEW OPPORTUNITY)
1 | # Example: Summarize PR changes for release notes |
3. Structured Data Extraction (NEW OPPORTUNITY)
1 | # Example: Extract action items from issue body |
Workflows to Keep on Copilot CLI
These workflows require tool calling and multi-step reasoning that actions/ai-inference cannot provide:
| Workflow | Reason to Keep on Copilot CLI |
|---|---|
copilot-issue-triage.yml |
Requires GitHub MCP to search code, find duplicates, create sub-issues |
copilot-todo-pr.yml |
Requires file editing, git operations, PR creation |
copilot-review.yml |
Requires code inspection, cross-file analysis |
screeps-monitoring.yml |
Requires Screeps MCP for console access, memory inspection |
copilot-strategic-planner.yml |
Requires multi-source data aggregation, issue management |
Proposed Hybrid Architecture
1 | ┌──────────────────────────────────────────────────────────────────────┐ |
Implementation Plan
Phase 1: Preparation (No Breaking Changes)
- Add
models: readpermission to relevant workflows as a non-functional change - Create
.github/prompts/directory foractions/ai-inferenceprompt files - Document migration patterns in this guide
Phase 2: Introduce Simple AI Tasks
Create new lightweight workflows using
actions/ai-inference:- Issue type classification
- PR description summarization
- Commit message improvement
Add as supplements, not replacements, to existing workflows
Phase 3: Optimize Existing Workflows
Identify hybrid opportunities where a workflow could use both:
actions/ai-inferencefor initial classification- Copilot CLI for complex follow-up actions
Measure cost and performance:
- Compare API costs
- Compare execution time
- Compare output quality
Phase 4: Full Adoption
- Migrate suitable workflows completely to
actions/ai-inference - Standardize prompt file format across the repository
- Update documentation and agent guidelines
Example Migration: Issue Classification Pre-Filter
This example shows how to add actions/ai-inference as a pre-filter before the existing Copilot CLI triage:
1 | name: Copilot Issue Triage |
Benefits of Adoption
1. Reduced Complexity
For simple tasks, actions/ai-inference eliminates:
- npm installation of Copilot CLI
- MCP server configuration
- Complex prompt templates with tool instructions
2. Structured Outputs
Native JSON schema support ensures type-safe responses:
1 | responseFormat: json_schema |
3. Cost Optimization
Simple classification tasks don’t need the overhead of full agent execution:
- Faster execution time
- Lower API costs for simple prompts
- No npm install/cache overhead
4. First-Party Support
actions/ai-inference is maintained by GitHub:
- Better integration with Actions ecosystem
- Future compatibility guaranteed
- Documentation and support
Risks and Mitigations
| Risk | Mitigation |
|---|---|
| Feature limitations | Use hybrid approach - keep Copilot CLI for complex tasks |
| Permission changes | The models: read permission is low-risk, read-only |
| Prompt format differences | Gradual migration, keep existing prompts working |
| Model availability | GitHub Models shares same underlying infrastructure |
| Response quality | Test thoroughly before migrating critical workflows |
Conclusion
The repository should adopt a hybrid approach:
Keep Copilot CLI for complex, multi-step agentic workflows that require:
- MCP tool calling (GitHub, Playwright, Screeps)
- File operations and git interactions
- Multi-phase reasoning with state
Adopt
actions/ai-inferencefor new, simple AI tasks:- Classification and categorization
- Text summarization
- Structured data extraction
- Pre-filters for existing workflows
Migrate incrementally with low-risk workflows first
This approach maximizes the benefits of both technologies while minimizing disruption to existing automation.