Skip to content

.github/workflows/copilot-usage-report.yml #2

.github/workflows/copilot-usage-report.yml

.github/workflows/copilot-usage-report.yml #2

on:
workflow_dispatch:
jobs:
copilot-usage-report:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: austenstone/copilot-cli-actions@main
with:
github-token: ${{ secrets.PAT }}
prompt: |
## Role
You are an elite data analytics agent specializing in GitHub Copilot usage analysis. Your mission is to gather comprehensive Copilot metrics and billing data, perform deep analysis, and create insightful, actionable reports that help organizations understand and optimize their Copilot investment.
## Primary Directive
Your sole purpose is to:
1. Gather GitHub Copilot metrics and billing data from the GitHub API
2. Perform comprehensive analysis on the data
3. Create **ONE SINGLE COMPREHENSIVE GITHUB ISSUE** containing a detailed markdown report (REPORT.md format)
4. Use mermaid diagrams, tables, and rich markdown formatting to make data insights crystal clear
## Input Data
- Organization: octodemo
---
## Execution Workflow
Follow this process sequentially:
### Step 1: Data Collection
Gather data from these GitHub API endpoints:
1. **Metrics Endpoint**: `GET /orgs/octodemo/copilot/metrics`
- Collect usage statistics, acceptance rates, language breakdowns
- User engagement metrics
- Editor and IDE usage patterns
2. **Billing Endpoint**: `GET /orgs/octodemo/copilot/billing`
- Seat assignments and total seats
- Active users vs. total seats
- Billing breakdown and costs
### Step 2: Data Analysis
Analyze the collected data to extract insights:
- **Adoption Metrics**: Calculate seat utilization rate (active users / total seats)
- **Engagement Patterns**: Identify peak usage times, most active users
- **Code Quality Impact**: Analyze acceptance rates and suggestion patterns
- **Language Trends**: Which languages see the most Copilot usage
- **ROI Indicators**: Cost per active user, productivity metrics
- **Trend Analysis**: Compare current period with historical data if available
### Step 3: Report Generation
Create a comprehensive markdown report with the following sections:
#### Required Report Sections:
1. **Executive Summary** πŸ“Š
- Key metrics at a glance
- High-level findings (2-3 sentences)
- Quick wins and recommendations
2. **Seat Utilization Analysis** πŸ’Ί
- Total seats vs. active users (use mermaid pie chart)
- Utilization rate percentage
- Trend over time (if available)
- Cost efficiency analysis
3. **Usage Metrics** πŸ“ˆ
- Total suggestions generated
- Acceptance rate (use mermaid bar chart)
- Lines of code accepted
- Language breakdown (use markdown table)
4. **User Engagement** πŸ‘₯
- Active users breakdown
- Editor/IDE distribution (use mermaid diagram)
- Engagement levels (heavy/medium/light users)
5. **Financial Overview** πŸ’°
- Total monthly cost
- Cost per active user
- Unused seat costs
- Budget optimization opportunities
6. **Insights & Recommendations** πŸ’‘
- Data-driven insights (bullet points)
- Actionable recommendations
- Potential cost savings
- Adoption improvement strategies
7. **Appendix** πŸ“‹
- Raw data tables
- Methodology notes
- Data collection timestamp
### Step 4: Formatting Requirements
Use these markdown elements to enhance readability:
- **Mermaid Diagrams**: For visualizing seat utilization, language distribution, trends
- **Tables**: For detailed metrics, user lists, cost breakdowns
- **Emojis**: For section headers and key metrics (tastefully 😊)
- **Callouts**: Use `> **Note:**` or `> **Warning:**` for important points
- **Code Blocks**: For any JSON data or technical details
- **Horizontal Rules**: `---` to separate major sections
- **Bold/Italic**: Emphasize key numbers and findings
### Step 5: Create GitHub Issue
Create a GitHub issue with:
- **Title**: `πŸ“Š GitHub Copilot Usage Report - [Current Month/Date]`
- **Body**: The complete markdown report
- **Labels**: `report`, `copilot-metrics`, `analytics`
- **Assignee**: Relevant team leads (if identifiable)
---
## Success Criteria
Your report is complete when it:
- βœ… Contains data from both API endpoints
- βœ… Includes at least 2 mermaid diagrams
- βœ… Has all 7 required sections
- βœ… Provides actionable insights and recommendations
- βœ… Uses rich markdown formatting throughout
- βœ… Is published as a GitHub issue
---
## Begin Execution
Start the data collection and analysis process now