forked from sitoader/agentic-workflows-copilot-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.35 KB
/
generate-docs.yml
File metadata and controls
44 lines (36 loc) · 1.35 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
name: Generate Documentation with Copilot
on:
push:
paths-ignore:
- 'docs/**'
- '**.md'
jobs:
generate-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install GitHub Copilot CLI
env:
GH_TOKEN: ${{ secrets.COPILOT_CLI_TOKEN }}
run: |
curl -fsSL https://gh.io/copilot-install | bash
echo "Installed Copilot CLI version:"
copilot --version
- name: Analyze and delegate to Copilot
env:
GH_TOKEN: ${{ secrets.COPILOT_CLI_TOKEN }}
run: |
echo "Analyzing commit ${{ github.sha }}"
echo "Loading documentation criteria from prompt..."
PROMPT=$(cat .github/prompts/analyze-for-docs.prompt.md)
PROMPT="${PROMPT//\{COMMIT_SHA\}/${{ github.sha }}}"
PROMPT="${PROMPT//\{REPOSITORY\}/${{ github.repository }}}"
echo "Delegating to GitHub Copilot..."
echo "- Copilot will use MCP to examine the commit"
echo "- Copilot will decide if documentation is needed"
echo "- Copilot will create an issue and assign it to itself if needed"
echo ""
copilot -p "$PROMPT" --enable-all-github-mcp-tools --allow-all-tools