-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (75 loc) · 3.92 KB
/
docs-update-bot.yml
File metadata and controls
90 lines (75 loc) · 3.92 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
name: Auggie Bot
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
permissions:
contents: write
issues: write
pull-requests: write
jobs:
documentation-generation:
runs-on: ubuntu-latest
# Only run if comment contains @update-docs
# Only allow trusted actors (org members, collaborators, or repo owner) to trigger
if: |
(
github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'COLLABORATOR'
) &&
contains(github.event.comment.body, '@update-docs')
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout docs repository
uses: actions/checkout@v4
with:
repository: augmentcode/docs
path: docs
token: ${{ secrets.TULGA_GITHUB_PAT_TOKEN }}
fetch-depth: 0
- name: Configure git for docs repository
working-directory: docs
run: |
git config user.email "auggie[bot]@users.noreply.github.com"
git config user.name "auggie[bot]"
git remote set-url origin https://x-access-token:${{ secrets.TULGA_GITHUB_PAT_TOKEN }}@github.com/augmentcode/docs.git
- name: Run Augment
uses: augmentcode/augment-action@main
with:
augment_api_key: ${{ secrets.AUGMENT_API_KEY }}
augment_api_url: ${{ vars.AUGMENT_API_URL }}
workspace_root: ${{ github.workspace }}
prompt: |
You are a documentation maintenance assistant. Your task is to ensure documentation stays synchronized with code changes.
## Workspace Structure
Your workspace contains TWO repositories:
- **Source repository** (`augmentcode/context-connectors`): Located at the workspace root (`.`)
- Use this to READ code changes and understand what was modified
- **Documentation repository** (`augmentcode/docs`): Located at `./docs/`
- Use this to WRITE documentation updates
- All commits, branches, and PRs must be created here
## Triggering PR
- PR #${{ github.event.issue.number }} in `augmentcode/context-connectors`
## Instructions
1. **Analyze the PR**: Read the code changes from the source repository (workspace root) to understand what functionality was added, modified, or removed. You can also use the GitHub API to get PR details.
2. **Identify documentation impact**: Determine if the changes affect:
- API references or method signatures
- Configuration options
- Usage examples or tutorials
- Installation or setup instructions
- Breaking changes or deprecations
3. **Update documentation**: If changes are needed, update the relevant files in the `docs/` directory (the docs repository).
4. **Create a PR in the docs repository**:
- Change directory to `docs/` before running git commands
- Create a new branch: `git checkout -b docs/update-from-context-connectors-pr-${{ github.event.issue.number }}`
- Stage and commit your changes
- Push the branch: `git push -u origin docs/update-from-context-connectors-pr-${{ github.event.issue.number }}`
- Create a pull request in `augmentcode/docs` using the GitHub API
- Reference the source PR: "Documentation updates for augmentcode/context-connectors#${{ github.event.issue.number }}"
- Comment on the source PR with the docs PR link
5. **No changes needed**: If the PR contains internal refactoring, test-only changes, or other modifications that don't affect user-facing documentation, comment that no documentation updates are required and briefly explain why.