claude-autopm 1.15.3 → 1.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -194,11 +194,11 @@ autopm mcp enable playwright-mcp
|
|
|
194
194
|
# Set up visual testing baselines
|
|
195
195
|
```
|
|
196
196
|
|
|
197
|
-
###
|
|
197
|
+
### Playwright Testing
|
|
198
198
|
```bash
|
|
199
|
-
autopm mcp enable
|
|
200
|
-
# Configure
|
|
201
|
-
# Set
|
|
199
|
+
autopm mcp enable playwright-mcp
|
|
200
|
+
# Configure browser automation
|
|
201
|
+
# Set test defaults
|
|
202
202
|
```
|
|
203
203
|
|
|
204
204
|
## Metrics and Monitoring
|
|
@@ -25,7 +25,7 @@ autopm mcp sync
|
|
|
25
25
|
|
|
26
26
|
```bash
|
|
27
27
|
# Copy and modify
|
|
28
|
-
cp .claude/examples/mcp/
|
|
28
|
+
cp .claude/examples/mcp/playwright-mcp.md .claude/mcp/my-custom-server.md
|
|
29
29
|
nano .claude/mcp/my-custom-server.md
|
|
30
30
|
|
|
31
31
|
# Enable and sync
|
|
@@ -46,7 +46,6 @@ autopm mcp add
|
|
|
46
46
|
- **context7.md** - Context7 up-to-date documentation database
|
|
47
47
|
|
|
48
48
|
### Integration Servers
|
|
49
|
-
- **github-mcp.md** - GitHub repository management
|
|
50
49
|
- **filesystem-mcp.md** - Local filesystem operations
|
|
51
50
|
|
|
52
51
|
### Testing Servers
|
|
@@ -20,11 +20,6 @@ Example MCP server configurations are available in `.claude/examples/mcp/`:
|
|
|
20
20
|
**Use Cases**: E2E testing, visual testing, browser automation
|
|
21
21
|
**Example**: `.claude/examples/mcp/playwright-mcp.md`
|
|
22
22
|
|
|
23
|
-
### github-mcp
|
|
24
|
-
**Description**: GitHub MCP server for repository management
|
|
25
|
-
**Use Cases**: Issue tracking, PR management, repository analysis
|
|
26
|
-
**Example**: `.claude/examples/mcp/github-mcp.md`
|
|
27
|
-
|
|
28
23
|
### filesystem-mcp
|
|
29
24
|
**Description**: Local filesystem access server
|
|
30
25
|
**Use Cases**: File operations, directory navigation, content management
|
|
@@ -101,7 +96,7 @@ autopm mcp add
|
|
|
101
96
|
cp .claude/examples/mcp/context7.md .claude/mcp/
|
|
102
97
|
|
|
103
98
|
# Or from installed framework
|
|
104
|
-
cp /path/to/framework/autopm/.claude/examples/mcp/
|
|
99
|
+
cp /path/to/framework/autopm/.claude/examples/mcp/playwright-mcp.md .claude/mcp/
|
|
105
100
|
```
|
|
106
101
|
|
|
107
102
|
### ✅ Enabling/Disabling Servers
|
package/package.json
CHANGED
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: github-mcp
|
|
3
|
-
command: npx
|
|
4
|
-
args: ["@modelcontextprotocol/server-github"]
|
|
5
|
-
env:
|
|
6
|
-
GITHUB_PERSONAL_ACCESS_TOKEN: "${GITHUB_TOKEN:-}"
|
|
7
|
-
GITHUB_API_URL: "${GITHUB_API_URL:-https://api.github.com}"
|
|
8
|
-
envFile: .claude/.env
|
|
9
|
-
description: GitHub MCP server for repository management and collaboration
|
|
10
|
-
category: integration
|
|
11
|
-
status: active
|
|
12
|
-
version: ">=1.0.0"
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# GitHub MCP Server
|
|
16
|
-
|
|
17
|
-
## Description
|
|
18
|
-
|
|
19
|
-
The GitHub MCP Server provides comprehensive GitHub integration through the Model Context Protocol, enabling repository management, issue tracking, pull request workflows, and collaborative development features.
|
|
20
|
-
|
|
21
|
-
## Features
|
|
22
|
-
|
|
23
|
-
- **Repository Management**: Create, clone, configure repositories
|
|
24
|
-
- **Issue Tracking**: Create, update, search issues
|
|
25
|
-
- **Pull Requests**: Create, review, merge PRs
|
|
26
|
-
- **Actions/Workflows**: Manage GitHub Actions
|
|
27
|
-
- **Code Search**: Search across repositories
|
|
28
|
-
- **Release Management**: Create and manage releases
|
|
29
|
-
- **Team Collaboration**: Manage teams and permissions
|
|
30
|
-
|
|
31
|
-
## Configuration
|
|
32
|
-
|
|
33
|
-
### Required Environment Variables
|
|
34
|
-
|
|
35
|
-
- `GITHUB_PERSONAL_ACCESS_TOKEN`: Your GitHub PAT (required)
|
|
36
|
-
|
|
37
|
-
### Optional Environment Variables
|
|
38
|
-
|
|
39
|
-
- `GITHUB_API_URL`: GitHub API endpoint (for GitHub Enterprise)
|
|
40
|
-
- `GITHUB_DEFAULT_OWNER`: Default repository owner
|
|
41
|
-
- `GITHUB_DEFAULT_REPO`: Default repository name
|
|
42
|
-
|
|
43
|
-
### Token Permissions
|
|
44
|
-
|
|
45
|
-
Required scopes for full functionality:
|
|
46
|
-
```
|
|
47
|
-
repo - Full repository access
|
|
48
|
-
workflow - GitHub Actions workflows
|
|
49
|
-
write:packages - Package registry
|
|
50
|
-
admin:org - Organization management (optional)
|
|
51
|
-
gist - Gist creation (optional)
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Usage Examples
|
|
55
|
-
|
|
56
|
-
### Basic Setup
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
# Enable the server
|
|
60
|
-
autopm mcp enable github-mcp
|
|
61
|
-
|
|
62
|
-
# Configure authentication
|
|
63
|
-
echo "GITHUB_TOKEN=ghp_your_token_here" >> .claude/.env
|
|
64
|
-
|
|
65
|
-
# For a specific repository
|
|
66
|
-
echo "GITHUB_DEFAULT_OWNER=your-username" >> .claude/.env
|
|
67
|
-
echo "GITHUB_DEFAULT_REPO=your-repo" >> .claude/.env
|
|
68
|
-
|
|
69
|
-
# Sync configuration
|
|
70
|
-
autopm mcp sync
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Integration with Agents
|
|
74
|
-
|
|
75
|
-
Commonly used with:
|
|
76
|
-
- `github-operations-specialist` - For DevOps workflows
|
|
77
|
-
- `code-analyzer` - For PR reviews
|
|
78
|
-
- `test-runner` - For CI/CD integration
|
|
79
|
-
|
|
80
|
-
## MCP Commands
|
|
81
|
-
|
|
82
|
-
### Repository Operations
|
|
83
|
-
|
|
84
|
-
```javascript
|
|
85
|
-
// Get repository info
|
|
86
|
-
github.getRepository({ owner, repo })
|
|
87
|
-
|
|
88
|
-
// Create repository
|
|
89
|
-
github.createRepository({
|
|
90
|
-
name: "new-repo",
|
|
91
|
-
description: "Repository description",
|
|
92
|
-
private: false,
|
|
93
|
-
auto_init: true
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
// List repositories
|
|
97
|
-
github.listRepositories({ type: "owner" })
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Issue Management
|
|
101
|
-
|
|
102
|
-
```javascript
|
|
103
|
-
// Create issue
|
|
104
|
-
github.createIssue({
|
|
105
|
-
title: "Bug: Application crashes",
|
|
106
|
-
body: "Detailed description...",
|
|
107
|
-
labels: ["bug", "high-priority"],
|
|
108
|
-
assignees: ["username"]
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
// Update issue
|
|
112
|
-
github.updateIssue({
|
|
113
|
-
issue_number: 123,
|
|
114
|
-
state: "closed",
|
|
115
|
-
labels: ["resolved"]
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
// Search issues
|
|
119
|
-
github.searchIssues({
|
|
120
|
-
query: "is:open label:bug"
|
|
121
|
-
})
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### Pull Request Workflows
|
|
125
|
-
|
|
126
|
-
```javascript
|
|
127
|
-
// Create PR
|
|
128
|
-
github.createPullRequest({
|
|
129
|
-
title: "Feature: Add new functionality",
|
|
130
|
-
head: "feature-branch",
|
|
131
|
-
base: "main",
|
|
132
|
-
body: "PR description..."
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
// Review PR
|
|
136
|
-
github.createReview({
|
|
137
|
-
pull_number: 456,
|
|
138
|
-
event: "APPROVE",
|
|
139
|
-
body: "LGTM!"
|
|
140
|
-
})
|
|
141
|
-
|
|
142
|
-
// Merge PR
|
|
143
|
-
github.mergePullRequest({
|
|
144
|
-
pull_number: 456,
|
|
145
|
-
merge_method: "squash"
|
|
146
|
-
})
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### GitHub Actions
|
|
150
|
-
|
|
151
|
-
```javascript
|
|
152
|
-
// Trigger workflow
|
|
153
|
-
github.triggerWorkflow({
|
|
154
|
-
workflow_id: "ci.yml",
|
|
155
|
-
ref: "main",
|
|
156
|
-
inputs: { environment: "production" }
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
// Get workflow runs
|
|
160
|
-
github.listWorkflowRuns({
|
|
161
|
-
workflow_id: "ci.yml",
|
|
162
|
-
status: "completed"
|
|
163
|
-
})
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
## Advanced Features
|
|
167
|
-
|
|
168
|
-
### Code Search
|
|
169
|
-
|
|
170
|
-
```javascript
|
|
171
|
-
// Search code
|
|
172
|
-
github.searchCode({
|
|
173
|
-
query: "function TODO in:file language:js repo:owner/repo"
|
|
174
|
-
})
|
|
175
|
-
|
|
176
|
-
// Search commits
|
|
177
|
-
github.searchCommits({
|
|
178
|
-
query: "fix bug author:username"
|
|
179
|
-
})
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### Release Management
|
|
183
|
-
|
|
184
|
-
```javascript
|
|
185
|
-
// Create release
|
|
186
|
-
github.createRelease({
|
|
187
|
-
tag_name: "v1.0.0",
|
|
188
|
-
name: "Version 1.0.0",
|
|
189
|
-
body: "Release notes...",
|
|
190
|
-
draft: false,
|
|
191
|
-
prerelease: false
|
|
192
|
-
})
|
|
193
|
-
|
|
194
|
-
// Upload release asset
|
|
195
|
-
github.uploadReleaseAsset({
|
|
196
|
-
release_id: 789,
|
|
197
|
-
name: "app.zip",
|
|
198
|
-
data: fileBuffer
|
|
199
|
-
})
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### Webhooks
|
|
203
|
-
|
|
204
|
-
```javascript
|
|
205
|
-
// Create webhook
|
|
206
|
-
github.createWebhook({
|
|
207
|
-
config: {
|
|
208
|
-
url: "https://example.com/webhook",
|
|
209
|
-
content_type: "json"
|
|
210
|
-
},
|
|
211
|
-
events: ["push", "pull_request"]
|
|
212
|
-
})
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
## Workflow Integration
|
|
216
|
-
|
|
217
|
-
### Automated PR Workflow
|
|
218
|
-
|
|
219
|
-
```yaml
|
|
220
|
-
workflow:
|
|
221
|
-
- create_branch: feature/new-feature
|
|
222
|
-
- commit_changes:
|
|
223
|
-
message: "Add new feature"
|
|
224
|
-
- create_pr:
|
|
225
|
-
title: "Feature: New functionality"
|
|
226
|
-
reviewers: ["reviewer1", "reviewer2"]
|
|
227
|
-
- wait_for_checks: true
|
|
228
|
-
- auto_merge:
|
|
229
|
-
method: squash
|
|
230
|
-
delete_branch: true
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
### Issue Triage
|
|
234
|
-
|
|
235
|
-
```yaml
|
|
236
|
-
triage:
|
|
237
|
-
rules:
|
|
238
|
-
- if: "title contains 'bug'"
|
|
239
|
-
then:
|
|
240
|
-
- add_label: bug
|
|
241
|
-
- assign_to: bug-team
|
|
242
|
-
- if: "title contains 'feature'"
|
|
243
|
-
then:
|
|
244
|
-
- add_label: enhancement
|
|
245
|
-
- add_to_project: feature-requests
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
## Best Practices
|
|
249
|
-
|
|
250
|
-
1. **Authentication**
|
|
251
|
-
- Use fine-grained PATs
|
|
252
|
-
- Rotate tokens regularly
|
|
253
|
-
- Store securely in .env
|
|
254
|
-
|
|
255
|
-
2. **Rate Limiting**
|
|
256
|
-
- Monitor API usage
|
|
257
|
-
- Implement caching
|
|
258
|
-
- Use conditional requests
|
|
259
|
-
|
|
260
|
-
3. **Branch Protection**
|
|
261
|
-
- Require PR reviews
|
|
262
|
-
- Enable status checks
|
|
263
|
-
- Protect main branch
|
|
264
|
-
|
|
265
|
-
4. **Automation**
|
|
266
|
-
- Use GitHub Actions for CI/CD
|
|
267
|
-
- Automate repetitive tasks
|
|
268
|
-
- Implement proper error handling
|
|
269
|
-
|
|
270
|
-
## Troubleshooting
|
|
271
|
-
|
|
272
|
-
### Common Issues
|
|
273
|
-
|
|
274
|
-
1. **Authentication Failed**
|
|
275
|
-
- Verify token is valid
|
|
276
|
-
- Check token permissions
|
|
277
|
-
- Ensure token hasn't expired
|
|
278
|
-
|
|
279
|
-
2. **Rate Limit Exceeded**
|
|
280
|
-
- Check rate limit status
|
|
281
|
-
- Implement exponential backoff
|
|
282
|
-
- Use authenticated requests
|
|
283
|
-
|
|
284
|
-
3. **Permission Denied**
|
|
285
|
-
- Verify repository access
|
|
286
|
-
- Check organization permissions
|
|
287
|
-
- Ensure proper token scopes
|
|
288
|
-
|
|
289
|
-
### Debug Mode
|
|
290
|
-
|
|
291
|
-
```bash
|
|
292
|
-
# Enable debug logging
|
|
293
|
-
export GITHUB_DEBUG=true
|
|
294
|
-
export NODE_DEBUG=github
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
## Security Considerations
|
|
298
|
-
|
|
299
|
-
1. **Token Security**
|
|
300
|
-
- Never commit tokens
|
|
301
|
-
- Use environment variables
|
|
302
|
-
- Implement token rotation
|
|
303
|
-
|
|
304
|
-
2. **Repository Access**
|
|
305
|
-
- Use least privilege principle
|
|
306
|
-
- Review collaborator permissions
|
|
307
|
-
- Enable 2FA
|
|
308
|
-
|
|
309
|
-
3. **Webhook Security**
|
|
310
|
-
- Validate webhook signatures
|
|
311
|
-
- Use HTTPS endpoints
|
|
312
|
-
- Implement IP allowlisting
|
|
313
|
-
|
|
314
|
-
## GitHub Enterprise
|
|
315
|
-
|
|
316
|
-
For GitHub Enterprise Server:
|
|
317
|
-
|
|
318
|
-
```bash
|
|
319
|
-
# Configure enterprise URL
|
|
320
|
-
export GITHUB_API_URL=https://github.enterprise.com/api/v3
|
|
321
|
-
export GITHUB_GRAPHQL_URL=https://github.enterprise.com/api/graphql
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
## Rate Limits
|
|
325
|
-
|
|
326
|
-
### API Limits
|
|
327
|
-
- Authenticated: 5,000 requests/hour
|
|
328
|
-
- Search: 30 requests/minute
|
|
329
|
-
- GraphQL: 5,000 points/hour
|
|
330
|
-
|
|
331
|
-
### Checking Rate Limit
|
|
332
|
-
|
|
333
|
-
```javascript
|
|
334
|
-
github.getRateLimit()
|
|
335
|
-
// Returns: { limit, remaining, reset }
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
## Version History
|
|
339
|
-
|
|
340
|
-
- **1.0.0**: Initial MCP integration
|
|
341
|
-
- **1.1.0**: Added Actions support
|
|
342
|
-
- **1.2.0**: GraphQL API integration
|
|
343
|
-
- **1.3.0**: Enterprise support
|
|
344
|
-
- **1.4.0**: Advanced search capabilities
|
|
345
|
-
|
|
346
|
-
## Related Resources
|
|
347
|
-
|
|
348
|
-
- [GitHub API Documentation](https://docs.github.com/en/rest)
|
|
349
|
-
- [GitHub Actions](https://docs.github.com/en/actions)
|
|
350
|
-
- [GitHub Operations Specialist](../agents/devops/github-operations-specialist.md)
|
|
@@ -1,350 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: github-mcp
|
|
3
|
-
command: npx
|
|
4
|
-
args: ["@modelcontextprotocol/server-github"]
|
|
5
|
-
env:
|
|
6
|
-
GITHUB_PERSONAL_ACCESS_TOKEN: "${GITHUB_TOKEN:-}"
|
|
7
|
-
GITHUB_API_URL: "${GITHUB_API_URL:-https://api.github.com}"
|
|
8
|
-
envFile: .claude/.env
|
|
9
|
-
description: GitHub MCP server for repository management and collaboration
|
|
10
|
-
category: integration
|
|
11
|
-
status: active
|
|
12
|
-
version: ">=1.0.0"
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
# GitHub MCP Server
|
|
16
|
-
|
|
17
|
-
## Description
|
|
18
|
-
|
|
19
|
-
The GitHub MCP Server provides comprehensive GitHub integration through the Model Context Protocol, enabling repository management, issue tracking, pull request workflows, and collaborative development features.
|
|
20
|
-
|
|
21
|
-
## Features
|
|
22
|
-
|
|
23
|
-
- **Repository Management**: Create, clone, configure repositories
|
|
24
|
-
- **Issue Tracking**: Create, update, search issues
|
|
25
|
-
- **Pull Requests**: Create, review, merge PRs
|
|
26
|
-
- **Actions/Workflows**: Manage GitHub Actions
|
|
27
|
-
- **Code Search**: Search across repositories
|
|
28
|
-
- **Release Management**: Create and manage releases
|
|
29
|
-
- **Team Collaboration**: Manage teams and permissions
|
|
30
|
-
|
|
31
|
-
## Configuration
|
|
32
|
-
|
|
33
|
-
### Required Environment Variables
|
|
34
|
-
|
|
35
|
-
- `GITHUB_PERSONAL_ACCESS_TOKEN`: Your GitHub PAT (required)
|
|
36
|
-
|
|
37
|
-
### Optional Environment Variables
|
|
38
|
-
|
|
39
|
-
- `GITHUB_API_URL`: GitHub API endpoint (for GitHub Enterprise)
|
|
40
|
-
- `GITHUB_DEFAULT_OWNER`: Default repository owner
|
|
41
|
-
- `GITHUB_DEFAULT_REPO`: Default repository name
|
|
42
|
-
|
|
43
|
-
### Token Permissions
|
|
44
|
-
|
|
45
|
-
Required scopes for full functionality:
|
|
46
|
-
```
|
|
47
|
-
repo - Full repository access
|
|
48
|
-
workflow - GitHub Actions workflows
|
|
49
|
-
write:packages - Package registry
|
|
50
|
-
admin:org - Organization management (optional)
|
|
51
|
-
gist - Gist creation (optional)
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## Usage Examples
|
|
55
|
-
|
|
56
|
-
### Basic Setup
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
# Enable the server
|
|
60
|
-
autopm mcp enable github-mcp
|
|
61
|
-
|
|
62
|
-
# Configure authentication
|
|
63
|
-
echo "GITHUB_TOKEN=ghp_your_token_here" >> .claude/.env
|
|
64
|
-
|
|
65
|
-
# For a specific repository
|
|
66
|
-
echo "GITHUB_DEFAULT_OWNER=your-username" >> .claude/.env
|
|
67
|
-
echo "GITHUB_DEFAULT_REPO=your-repo" >> .claude/.env
|
|
68
|
-
|
|
69
|
-
# Sync configuration
|
|
70
|
-
autopm mcp sync
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Integration with Agents
|
|
74
|
-
|
|
75
|
-
Commonly used with:
|
|
76
|
-
- `github-operations-specialist` - For DevOps workflows
|
|
77
|
-
- `code-analyzer` - For PR reviews
|
|
78
|
-
- `test-runner` - For CI/CD integration
|
|
79
|
-
|
|
80
|
-
## MCP Commands
|
|
81
|
-
|
|
82
|
-
### Repository Operations
|
|
83
|
-
|
|
84
|
-
```javascript
|
|
85
|
-
// Get repository info
|
|
86
|
-
github.getRepository({ owner, repo })
|
|
87
|
-
|
|
88
|
-
// Create repository
|
|
89
|
-
github.createRepository({
|
|
90
|
-
name: "new-repo",
|
|
91
|
-
description: "Repository description",
|
|
92
|
-
private: false,
|
|
93
|
-
auto_init: true
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
// List repositories
|
|
97
|
-
github.listRepositories({ type: "owner" })
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Issue Management
|
|
101
|
-
|
|
102
|
-
```javascript
|
|
103
|
-
// Create issue
|
|
104
|
-
github.createIssue({
|
|
105
|
-
title: "Bug: Application crashes",
|
|
106
|
-
body: "Detailed description...",
|
|
107
|
-
labels: ["bug", "high-priority"],
|
|
108
|
-
assignees: ["username"]
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
// Update issue
|
|
112
|
-
github.updateIssue({
|
|
113
|
-
issue_number: 123,
|
|
114
|
-
state: "closed",
|
|
115
|
-
labels: ["resolved"]
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
// Search issues
|
|
119
|
-
github.searchIssues({
|
|
120
|
-
query: "is:open label:bug"
|
|
121
|
-
})
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### Pull Request Workflows
|
|
125
|
-
|
|
126
|
-
```javascript
|
|
127
|
-
// Create PR
|
|
128
|
-
github.createPullRequest({
|
|
129
|
-
title: "Feature: Add new functionality",
|
|
130
|
-
head: "feature-branch",
|
|
131
|
-
base: "main",
|
|
132
|
-
body: "PR description..."
|
|
133
|
-
})
|
|
134
|
-
|
|
135
|
-
// Review PR
|
|
136
|
-
github.createReview({
|
|
137
|
-
pull_number: 456,
|
|
138
|
-
event: "APPROVE",
|
|
139
|
-
body: "LGTM!"
|
|
140
|
-
})
|
|
141
|
-
|
|
142
|
-
// Merge PR
|
|
143
|
-
github.mergePullRequest({
|
|
144
|
-
pull_number: 456,
|
|
145
|
-
merge_method: "squash"
|
|
146
|
-
})
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### GitHub Actions
|
|
150
|
-
|
|
151
|
-
```javascript
|
|
152
|
-
// Trigger workflow
|
|
153
|
-
github.triggerWorkflow({
|
|
154
|
-
workflow_id: "ci.yml",
|
|
155
|
-
ref: "main",
|
|
156
|
-
inputs: { environment: "production" }
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
// Get workflow runs
|
|
160
|
-
github.listWorkflowRuns({
|
|
161
|
-
workflow_id: "ci.yml",
|
|
162
|
-
status: "completed"
|
|
163
|
-
})
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
## Advanced Features
|
|
167
|
-
|
|
168
|
-
### Code Search
|
|
169
|
-
|
|
170
|
-
```javascript
|
|
171
|
-
// Search code
|
|
172
|
-
github.searchCode({
|
|
173
|
-
query: "function TODO in:file language:js repo:owner/repo"
|
|
174
|
-
})
|
|
175
|
-
|
|
176
|
-
// Search commits
|
|
177
|
-
github.searchCommits({
|
|
178
|
-
query: "fix bug author:username"
|
|
179
|
-
})
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### Release Management
|
|
183
|
-
|
|
184
|
-
```javascript
|
|
185
|
-
// Create release
|
|
186
|
-
github.createRelease({
|
|
187
|
-
tag_name: "v1.0.0",
|
|
188
|
-
name: "Version 1.0.0",
|
|
189
|
-
body: "Release notes...",
|
|
190
|
-
draft: false,
|
|
191
|
-
prerelease: false
|
|
192
|
-
})
|
|
193
|
-
|
|
194
|
-
// Upload release asset
|
|
195
|
-
github.uploadReleaseAsset({
|
|
196
|
-
release_id: 789,
|
|
197
|
-
name: "app.zip",
|
|
198
|
-
data: fileBuffer
|
|
199
|
-
})
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
### Webhooks
|
|
203
|
-
|
|
204
|
-
```javascript
|
|
205
|
-
// Create webhook
|
|
206
|
-
github.createWebhook({
|
|
207
|
-
config: {
|
|
208
|
-
url: "https://example.com/webhook",
|
|
209
|
-
content_type: "json"
|
|
210
|
-
},
|
|
211
|
-
events: ["push", "pull_request"]
|
|
212
|
-
})
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
## Workflow Integration
|
|
216
|
-
|
|
217
|
-
### Automated PR Workflow
|
|
218
|
-
|
|
219
|
-
```yaml
|
|
220
|
-
workflow:
|
|
221
|
-
- create_branch: feature/new-feature
|
|
222
|
-
- commit_changes:
|
|
223
|
-
message: "Add new feature"
|
|
224
|
-
- create_pr:
|
|
225
|
-
title: "Feature: New functionality"
|
|
226
|
-
reviewers: ["reviewer1", "reviewer2"]
|
|
227
|
-
- wait_for_checks: true
|
|
228
|
-
- auto_merge:
|
|
229
|
-
method: squash
|
|
230
|
-
delete_branch: true
|
|
231
|
-
```
|
|
232
|
-
|
|
233
|
-
### Issue Triage
|
|
234
|
-
|
|
235
|
-
```yaml
|
|
236
|
-
triage:
|
|
237
|
-
rules:
|
|
238
|
-
- if: "title contains 'bug'"
|
|
239
|
-
then:
|
|
240
|
-
- add_label: bug
|
|
241
|
-
- assign_to: bug-team
|
|
242
|
-
- if: "title contains 'feature'"
|
|
243
|
-
then:
|
|
244
|
-
- add_label: enhancement
|
|
245
|
-
- add_to_project: feature-requests
|
|
246
|
-
```
|
|
247
|
-
|
|
248
|
-
## Best Practices
|
|
249
|
-
|
|
250
|
-
1. **Authentication**
|
|
251
|
-
- Use fine-grained PATs
|
|
252
|
-
- Rotate tokens regularly
|
|
253
|
-
- Store securely in .env
|
|
254
|
-
|
|
255
|
-
2. **Rate Limiting**
|
|
256
|
-
- Monitor API usage
|
|
257
|
-
- Implement caching
|
|
258
|
-
- Use conditional requests
|
|
259
|
-
|
|
260
|
-
3. **Branch Protection**
|
|
261
|
-
- Require PR reviews
|
|
262
|
-
- Enable status checks
|
|
263
|
-
- Protect main branch
|
|
264
|
-
|
|
265
|
-
4. **Automation**
|
|
266
|
-
- Use GitHub Actions for CI/CD
|
|
267
|
-
- Automate repetitive tasks
|
|
268
|
-
- Implement proper error handling
|
|
269
|
-
|
|
270
|
-
## Troubleshooting
|
|
271
|
-
|
|
272
|
-
### Common Issues
|
|
273
|
-
|
|
274
|
-
1. **Authentication Failed**
|
|
275
|
-
- Verify token is valid
|
|
276
|
-
- Check token permissions
|
|
277
|
-
- Ensure token hasn't expired
|
|
278
|
-
|
|
279
|
-
2. **Rate Limit Exceeded**
|
|
280
|
-
- Check rate limit status
|
|
281
|
-
- Implement exponential backoff
|
|
282
|
-
- Use authenticated requests
|
|
283
|
-
|
|
284
|
-
3. **Permission Denied**
|
|
285
|
-
- Verify repository access
|
|
286
|
-
- Check organization permissions
|
|
287
|
-
- Ensure proper token scopes
|
|
288
|
-
|
|
289
|
-
### Debug Mode
|
|
290
|
-
|
|
291
|
-
```bash
|
|
292
|
-
# Enable debug logging
|
|
293
|
-
export GITHUB_DEBUG=true
|
|
294
|
-
export NODE_DEBUG=github
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
## Security Considerations
|
|
298
|
-
|
|
299
|
-
1. **Token Security**
|
|
300
|
-
- Never commit tokens
|
|
301
|
-
- Use environment variables
|
|
302
|
-
- Implement token rotation
|
|
303
|
-
|
|
304
|
-
2. **Repository Access**
|
|
305
|
-
- Use least privilege principle
|
|
306
|
-
- Review collaborator permissions
|
|
307
|
-
- Enable 2FA
|
|
308
|
-
|
|
309
|
-
3. **Webhook Security**
|
|
310
|
-
- Validate webhook signatures
|
|
311
|
-
- Use HTTPS endpoints
|
|
312
|
-
- Implement IP allowlisting
|
|
313
|
-
|
|
314
|
-
## GitHub Enterprise
|
|
315
|
-
|
|
316
|
-
For GitHub Enterprise Server:
|
|
317
|
-
|
|
318
|
-
```bash
|
|
319
|
-
# Configure enterprise URL
|
|
320
|
-
export GITHUB_API_URL=https://github.enterprise.com/api/v3
|
|
321
|
-
export GITHUB_GRAPHQL_URL=https://github.enterprise.com/api/graphql
|
|
322
|
-
```
|
|
323
|
-
|
|
324
|
-
## Rate Limits
|
|
325
|
-
|
|
326
|
-
### API Limits
|
|
327
|
-
- Authenticated: 5,000 requests/hour
|
|
328
|
-
- Search: 30 requests/minute
|
|
329
|
-
- GraphQL: 5,000 points/hour
|
|
330
|
-
|
|
331
|
-
### Checking Rate Limit
|
|
332
|
-
|
|
333
|
-
```javascript
|
|
334
|
-
github.getRateLimit()
|
|
335
|
-
// Returns: { limit, remaining, reset }
|
|
336
|
-
```
|
|
337
|
-
|
|
338
|
-
## Version History
|
|
339
|
-
|
|
340
|
-
- **1.0.0**: Initial MCP integration
|
|
341
|
-
- **1.1.0**: Added Actions support
|
|
342
|
-
- **1.2.0**: GraphQL API integration
|
|
343
|
-
- **1.3.0**: Enterprise support
|
|
344
|
-
- **1.4.0**: Advanced search capabilities
|
|
345
|
-
|
|
346
|
-
## Related Resources
|
|
347
|
-
|
|
348
|
-
- [GitHub API Documentation](https://docs.github.com/en/rest)
|
|
349
|
-
- [GitHub Actions](https://docs.github.com/en/actions)
|
|
350
|
-
- [GitHub Operations Specialist](../agents/devops/github-operations-specialist.md)
|