1- # Comment Reaction Action
1+ # PR Assistant Action
22
3- A GitHub Action that adds emoji reactions to comments on pull requests and issues .
3+ An AI-powered GitHub Action that implements code changes based on PR comments using the Auggie SDK .
44
55## Features
66
7- - ✅ React to PR review comments
8- - ✅ React to issue comments
9- - ✅ Support for all GitHub reaction types
10- - ✅ TypeScript implementation with full type safety
11- - ✅ Detailed error messages and logging
7+ - 🤖 ** AI-Powered Implementation** : Uses Auggie SDK to understand and implement requested changes
8+ - 📋 ** Context-Aware** : Gathers full PR context including diff, files, and comment threads
9+ - 🔄 ** Automatic Commits** : Commits and pushes changes directly to the PR branch
10+ - 💬 ** Status Updates** : Posts success/failure comments to the PR
11+ - 👀 ** Visual Feedback** : Adds emoji reactions to show processing status
12+ - ✅ ** Full TypeScript** : Type-safe implementation with comprehensive error handling
1213
1314## Usage
1415
1516### Basic Example
1617
1718``` yaml
18- - name : React to comment with eyes
19- uses : augmentcode/augment-agent/comment-reaction @feature/comment-reaction-action
19+ - name : PR Assistant
20+ uses : augmentcode/augment-agent/assistant @feature/comment-reaction-action
2021 with :
2122 github_token : ${{ secrets.GITHUB_TOKEN }}
2223 comment_id : ${{ github.event.comment.id }}
2324 event_name : ${{ github.event_name }}
25+ augment_api_token : ${{ secrets.AUGMENT_API_KEY }}
26+ augment_api_url : ${{ secrets.AUGMENT_API_URL }}
2427` ` `
2528
26- ### Custom Reaction
29+ ### With Custom Reaction
2730
2831` ` ` yaml
29- - name : React to comment with rocket
30- uses : augmentcode/augment-agent/comment-reaction @feature/comment-reaction-action
32+ - name : PR Assistant
33+ uses : augmentcode/augment-agent/assistant @feature/comment-reaction-action
3134 with :
3235 github_token : ${{ secrets.GITHUB_TOKEN }}
3336 comment_id : ${{ github.event.comment.id }}
3437 event_name : ${{ github.event_name }}
3538 reaction : rocket
39+ augment_api_token : ${{ secrets.AUGMENT_API_KEY }}
40+ augment_api_url : ${{ secrets.AUGMENT_API_URL }}
3641` ` `
3742
3843### Complete Workflow Example
3944
4045` ` ` yaml
41- name : React to Comments
46+ name : PR Assistant
4247on :
4348 pull_request_review_comment :
4449 types : [created]
@@ -51,26 +56,51 @@ permissions:
5156 issues : write
5257
5358jobs :
54- react :
59+ assistant :
60+ if : |
61+ contains(github.event.comment.body, '@augment') ||
62+ contains(github.event.comment.body, '@Augment')
5563 runs-on : ubuntu-latest
5664 steps :
57- - name : React to comment
58- uses : augmentcode/augment-agent/comment-reaction@feature/comment-reaction-action
65+ - name : Checkout code
66+ uses : actions/checkout@v4
67+ with :
68+ repository : ${{ github.repository }}
69+ token : ${{ secrets.GITHUB_TOKEN }}
70+ ref : ${{ github.event.pull_request.head.ref }}
71+
72+ - name : Run PR Assistant
73+ uses : augmentcode/augment-agent/assistant@feature/comment-reaction-action
5974 with :
6075 github_token : ${{ secrets.GITHUB_TOKEN }}
6176 comment_id : ${{ github.event.comment.id }}
6277 event_name : ${{ github.event_name }}
6378 reaction : eyes
79+ augment_api_token : ${{ secrets.AUGMENT_API_KEY }}
80+ augment_api_url : ${{ secrets.AUGMENT_API_URL }}
6481` ` `
6582
83+ ## How It Works
84+
85+ 1. **Trigger**: Workflow is triggered by a comment containing ` @augment` or `@Augment`
86+ 2. **React** : Adds an emoji reaction (default: 👀) to show processing has started
87+ 3. **Gather Context** : Collects PR metadata, diff, files changed, and comment thread
88+ 4. **Invoke Auggie** : Sends the context and instruction to Auggie SDK
89+ 5. **Implement** : Auggie analyzes the request and implements the changes
90+ 6. **Commit** : Automatically commits changes with a descriptive message
91+ 7. **Push** : Pushes the commit to the PR's head branch
92+ 8. **Notify** : Posts a success or failure comment to the PR
93+
6694# # Inputs
6795
6896| Input | Description | Required | Default |
6997|-------|-------------|----------|---------|
70- | ` github_token` | GitHub token for API access. Must have permissions to add reactions. | Yes | - |
71- | `comment_id` | The ID of the comment to react to | Yes | - |
98+ | `github_token` | GitHub token for API access and git operations | Yes | - |
99+ | `comment_id` | The ID of the comment that triggered the workflow | Yes | - |
72100| `event_name` | The GitHub event name (`pull_request_review_comment` or `issue_comment`) | Yes | - |
73- | `reaction` | The reaction type to add | No | `eyes` |
101+ | `augment_api_token` | Augment API token for authentication | Yes | - |
102+ | `augment_api_url` | Augment API URL endpoint | Yes | - |
103+ | `reaction` | The reaction type to add (optional) | No | `eyes` |
74104
75105# # Supported Reactions
76106
@@ -95,10 +125,65 @@ The action requires the following permissions:
95125
96126` ` ` yaml
97127permissions:
98- pull-requests: write # For PR review comments
99- issues: write # For issue comments
128+ contents: read # To read repository content
129+ pull-requests: write # To add reactions and comments to PRs
130+ issues: write # To add reactions and comments to issues
100131` ` `
101132
133+ # # Setup
134+
135+ # ## 1. Configure Secrets
136+
137+ Add the following secrets to your repository :
138+
139+ - `AUGMENT_API_KEY` : Your Augment API token
140+ - `AUGMENT_API_URL` : Your Augment API URL endpoint
141+
142+ # ## 2. Create Workflow
143+
144+ Create `.github/workflows/assistant.yml` with the example workflow above.
145+
146+ # ## 3. Test
147+
148+ Create a test PR and comment with `@augment <your instruction>`. For example :
149+
150+ ` ` `
151+ @augment Add error handling to the login function
152+ ` ` `
153+
154+ The assistant will :
155+ - React with 👀 to acknowledge
156+ - Gather PR context
157+ - Implement the requested changes
158+ - Commit and push to the PR branch
159+ - Comment with the result
160+
161+ # # Example Instructions
162+
163+ - ` @augment Add unit tests for the UserService class`
164+ - ` @augment Refactor this function to use async/await`
165+ - ` @augment Fix the TypeScript errors in this file`
166+ - ` @augment Add JSDoc comments to all exported functions`
167+ - ` @augment Implement the TODO comments in this PR`
168+
169+ # # Troubleshooting
170+
171+ # ## No changes committed
172+
173+ - Check that Auggie has write access to the repository
174+ - Verify that the PR branch is not protected
175+ - Check the workflow logs for errors
176+
177+ # ## Auggie fails to connect
178+
179+ - Verify `AUGMENT_API_KEY` and `AUGMENT_API_URL` are set correctly
180+ - Check that the API endpoint is accessible from GitHub Actions
181+
182+ # ## Changes not appearing
183+
184+ - Ensure the workflow has `contents : write` permission
185+ - Check that the checkout step uses the correct branch reference
186+
102187# # License
103188
104189MIT
0 commit comments