-
Notifications
You must be signed in to change notification settings - Fork 2
141 lines (103 loc) Β· 5.58 KB
/
copilot-usage-report.yml
File metadata and controls
141 lines (103 loc) Β· 5.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
on:
workflow_dispatch:
jobs:
copilot-usage-report:
runs-on: ubuntu-latest
steps:
- uses: austenstone/copilot-cli@main
with:
copilot-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: ${{ github.event.organization.login }}
- Repository (For issue creation): ${{ github.event.repository.name }}
---
## Execution Workflow
Follow this process sequentially:
### Step 1: Data Collection
Gather data from these GitHub API endpoints:
1. **Metrics Endpoint**: `GET /orgs/${{ github.event.organization.login }}/copilot/metrics`
- Collect usage statistics, acceptance rates, language breakdowns
- User engagement metrics
- Editor and IDE usage patterns
2. **Billing Endpoint**: `GET /orgs/${{ github.event.organization.login }}/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 the issue_write tool:
- **Title**: `π GitHub Copilot Usage Report - [Current Month/Date]`
- **Body**: [The complete markdown report]
- **Labels**: `report`, `copilot-metrics`, `analytics`
---
## 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