Skip to content

Commit 593425b

Browse files
committed
feat: add MCP configuration for GitHub Copilot and update workflow environment variables
1 parent d6668f6 commit 593425b

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

.github/mcp.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"mcpServers": {
3+
"github": {
4+
"type": "http",
5+
"url": "https://api.githubcopilot.com/mcp/",
6+
"headers": {
7+
"Authorization": "Bearer ${GITHUB_MCP_TOKEN}"
8+
}
9+
}
10+
}
11+
}

.github/workflows/copilot.generate-docs.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@ jobs:
2020
fetch-depth: 0
2121

2222
- name: Install GitHub Copilot CLI
23+
env:
24+
GH_TOKEN: ${{ secrets.COPILOT_CLI_TOKEN }}
2325
run: |
2426
curl -fsSL https://gh.io/copilot-install | bash
2527
echo "Installed Copilot CLI version:"
2628
copilot --version
2729
2830
- name: Analyze and delegate to Copilot
2931
env:
30-
GITHUB_TOKEN: ${{ secrets.COPILOT_CLI_TOKEN }}
32+
GH_TOKEN: ${{ secrets.COPILOT_CLI_TOKEN }} # Personal PAT for Copilot API authentication
33+
GITHUB_MCP_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Workflow token for MCP GitHub operations (issues)
3134
run: |
3235
echo "Analyzing commit ${{ github.sha }}"
3336
echo "Loading documentation criteria from prompt..."
@@ -42,4 +45,6 @@ jobs:
4245
echo "- Copilot will create an issue and assign it to itself if needed"
4346
echo ""
4447
45-
copilot -p "$PROMPT" --enable-all-github-mcp-tools --allow-all-tools
48+
copilot -p "$PROMPT" \
49+
--mcp-config .github/mcp.json \
50+
--allow-all-tools

0 commit comments

Comments
 (0)