|
1 | 1 | # Augment Action |
2 | 2 |
|
3 | | -A GitHub Action that automatically reacts to comments with an emoji (👀 eyes) when triggered. Perfect for bot interactions and automated comment acknowledgments. |
4 | | - |
5 | | -## Features |
6 | | - |
7 | | -- 🎯 Reacts to issue comments and pull request review comments |
8 | | -- 👀 Adds an "eyes" emoji reaction to acknowledge the comment |
9 | | -- 🤖 Can be triggered by specific keywords (e.g., `@auggiebot`) |
10 | | -- ⚡ Fast and lightweight |
| 3 | +A GitHub Action that runs the Auggie AI agent to respond to issue and PR comments. |
11 | 4 |
|
12 | 5 | ## Usage |
13 | 6 |
|
14 | | -### Basic Setup |
15 | | - |
16 | | -Create a workflow file in your repository at `.github/workflows/auggie-bot.yml`: |
17 | | - |
18 | 7 | ```yaml |
19 | 8 | name: Auggie Bot |
20 | 9 |
|
|
25 | 14 | types: [created] |
26 | 15 |
|
27 | 16 | jobs: |
28 | | - react-to-comment: |
| 17 | + auggie: |
29 | 18 | runs-on: ubuntu-latest |
30 | | - if: contains(github.event.comment.body, '@auggiebot') |
31 | | - |
| 19 | + if: contains(github.event.comment.body, '@auggie') |
32 | 20 | steps: |
33 | | - - name: Checkout augment-action |
34 | | - uses: actions/checkout@v4 |
35 | | - with: |
36 | | - repository: augmentcode/augment-action |
37 | | - path: augment-action |
| 21 | + - uses: actions/checkout@v4 |
38 | 22 |
|
39 | | - - name: React with eyes emoji |
40 | | - uses: ./augment-action |
| 23 | + - uses: augmentcode/augment-action@main |
41 | 24 | with: |
42 | | - github_token: ${{ secrets.GITHUB_TOKEN }} |
43 | | - comment_id: ${{ github.event.comment.id }} |
44 | | - event_name: ${{ github.event_name }} |
| 25 | + prompt: ${{ github.event.comment.body }} |
| 26 | + augment_api_key: ${{ secrets.AUGMENT_API_KEY }} |
45 | 27 | ``` |
46 | 28 |
|
47 | | -### Inputs |
| 29 | +## Inputs |
48 | 30 |
|
49 | 31 | | Input | Description | Required | |
50 | 32 | |-------|-------------|----------| |
51 | | -| `github_token` | GitHub token for API access (use `${{ secrets.GITHUB_TOKEN }}`) | Yes | |
52 | | -| `comment_id` | The ID of the comment to react to (use `${{ github.event.comment.id }}`) | Yes | |
53 | | -| `event_name` | The GitHub event name: `issue_comment` or `pull_request_review_comment` (use `${{ github.event_name }}`) | Yes | |
54 | | - |
55 | | -### Outputs |
| 33 | +| `prompt` | The prompt to send to the Auggie agent | Yes | |
| 34 | +| `augment_api_key` | Augment API key for authentication | No | |
| 35 | +| `augment_api_url` | Augment API URL (default: `https://api.augmentcode.com`) | No | |
| 36 | +| `workspace_root` | Workspace root path for Auggie to index | No | |
56 | 37 |
|
57 | | -| Output | Description | |
58 | | -|--------|-------------| |
59 | | -| `success` | Whether the reaction was successfully added (`true` or `false`) | |
| 38 | +## What It Does |
60 | 39 |
|
61 | | -### Customization |
| 40 | +The Auggie agent will: |
| 41 | +1. React to your comment with 👀 to acknowledge the request |
| 42 | +2. Post a comment with its response |
| 43 | +3. Update the comment in real-time as it works through the task |
62 | 44 |
|
63 | | -#### Trigger on Different Keywords |
| 45 | +## Use Cases |
64 | 46 |
|
65 | | -Change the `if` condition to trigger on different text: |
| 47 | +### 1. Respond to Comments |
66 | 48 |
|
67 | | -```yaml |
68 | | -if: contains(github.event.comment.body, '@mybot') |
69 | | -``` |
70 | | - |
71 | | -#### Trigger on All Comments |
72 | | - |
73 | | -Remove the `if` condition to react to all comments: |
| 49 | +Trigger Auggie when someone mentions `@auggie` in a comment: |
74 | 50 |
|
75 | | -```yaml |
76 | | -jobs: |
77 | | - react-to-comment: |
78 | | - runs-on: ubuntu-latest |
79 | | - # No if condition - reacts to all comments |
80 | | - steps: |
81 | | - # ... |
82 | | -``` |
83 | | - |
84 | | -#### Only Trigger on Issues or PRs |
85 | | - |
86 | | -For issues only: |
87 | 51 | ```yaml |
88 | 52 | on: |
89 | 53 | issue_comment: |
90 | 54 | types: [created] |
91 | | -``` |
92 | | - |
93 | | -For PR review comments only: |
94 | | -```yaml |
95 | | -on: |
96 | 55 | pull_request_review_comment: |
97 | 56 | types: [created] |
98 | | -``` |
99 | | - |
100 | | -## Development |
101 | | - |
102 | | -### Prerequisites |
103 | | - |
104 | | -- [Bun](https://bun.sh) v1.2.15 or later |
105 | | - |
106 | | -### Install Dependencies |
107 | 57 |
|
108 | | -```bash |
109 | | -bun install |
110 | | -``` |
111 | | - |
112 | | -### Run Tests |
113 | | - |
114 | | -```bash |
115 | | -bun test |
| 58 | +jobs: |
| 59 | + auggie: |
| 60 | + runs-on: ubuntu-latest |
| 61 | + if: contains(github.event.comment.body, '@auggie') |
| 62 | + steps: |
| 63 | + - uses: actions/checkout@v4 |
| 64 | + - uses: augmentcode/augment-action@main |
| 65 | + with: |
| 66 | + prompt: ${{ github.event.comment.body }} |
| 67 | + augment_api_key: ${{ secrets.AUGMENT_API_KEY }} |
116 | 68 | ``` |
117 | 69 |
|
118 | | -### Type Check |
| 70 | +### 2. Auto Code Review on PRs |
119 | 71 |
|
120 | | -```bash |
121 | | -bun run typecheck |
122 | | -``` |
| 72 | +Automatically review every new pull request: |
123 | 73 |
|
124 | | -### Run Locally |
| 74 | +```yaml |
| 75 | +on: |
| 76 | + pull_request: |
| 77 | + types: [opened, synchronize] |
125 | 78 |
|
126 | | -```bash |
127 | | -bun run index.ts |
| 79 | +jobs: |
| 80 | + auggie: |
| 81 | + runs-on: ubuntu-latest |
| 82 | + steps: |
| 83 | + - uses: actions/checkout@v4 |
| 84 | + - uses: augmentcode/augment-action@main |
| 85 | + with: |
| 86 | + prompt: "Review this PR for bugs, security issues, and code quality" |
| 87 | + augment_api_key: ${{ secrets.AUGMENT_API_KEY }} |
128 | 88 | ``` |
129 | 89 |
|
130 | | -## How It Works |
| 90 | +### 3. Triage New Issues |
131 | 91 |
|
132 | | -1. The workflow is triggered when a comment is created on an issue or pull request |
133 | | -2. If the comment contains the specified keyword (e.g., `@auggiebot`), the action runs |
134 | | -3. The action uses the GitHub API to add a 👀 (eyes) reaction to the comment |
135 | | -4. The action reports success or failure |
| 92 | +Automatically analyze and label new issues: |
136 | 93 |
|
137 | | -## Example |
138 | | - |
139 | | -When you comment on an issue or PR with: |
| 94 | +```yaml |
| 95 | +on: |
| 96 | + issues: |
| 97 | + types: [opened] |
140 | 98 |
|
| 99 | +jobs: |
| 100 | + auggie: |
| 101 | + runs-on: ubuntu-latest |
| 102 | + steps: |
| 103 | + - uses: actions/checkout@v4 |
| 104 | + - uses: augmentcode/augment-action@main |
| 105 | + with: |
| 106 | + prompt: "Analyze this issue, suggest relevant labels, and provide initial guidance" |
| 107 | + augment_api_key: ${{ secrets.AUGMENT_API_KEY }} |
141 | 108 | ``` |
142 | | -@auggiebot please review this |
143 | | -``` |
144 | | - |
145 | | -The action will automatically add a 👀 reaction to your comment, indicating that the bot has seen it. |
146 | | - |
147 | | -## License |
148 | | - |
149 | | -See [LICENSE](LICENSE) file for details. |
150 | | - |
151 | | -## Contributing |
152 | | - |
153 | | -Contributions are welcome! Please feel free to submit a Pull Request. |
0 commit comments