Skip to content

Commit 1982713

Browse files
committed
GITHUB_TOKEN input no longer necessary
1 parent 5119d54 commit 1982713

6 files changed

Lines changed: 66 additions & 120 deletions

File tree

README.md

Lines changed: 60 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,9 @@
11
# Augment Action
22

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.
114

125
## Usage
136

14-
### Basic Setup
15-
16-
Create a workflow file in your repository at `.github/workflows/auggie-bot.yml`:
17-
187
```yaml
198
name: Auggie Bot
209

@@ -25,129 +14,95 @@ on:
2514
types: [created]
2615

2716
jobs:
28-
react-to-comment:
17+
auggie:
2918
runs-on: ubuntu-latest
30-
if: contains(github.event.comment.body, '@auggiebot')
31-
19+
if: contains(github.event.comment.body, '@auggie')
3220
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
3822

39-
- name: React with eyes emoji
40-
uses: ./augment-action
23+
- uses: augmentcode/augment-action@main
4124
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 }}
4527
```
4628
47-
### Inputs
29+
## Inputs
4830
4931
| Input | Description | Required |
5032
|-------|-------------|----------|
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 |
5637

57-
| Output | Description |
58-
|--------|-------------|
59-
| `success` | Whether the reaction was successfully added (`true` or `false`) |
38+
## What It Does
6039

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
6244

63-
#### Trigger on Different Keywords
45+
## Use Cases
6446

65-
Change the `if` condition to trigger on different text:
47+
### 1. Respond to Comments
6648

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:
7450

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:
8751
```yaml
8852
on:
8953
issue_comment:
9054
types: [created]
91-
```
92-
93-
For PR review comments only:
94-
```yaml
95-
on:
9655
pull_request_review_comment:
9756
types: [created]
98-
```
99-
100-
## Development
101-
102-
### Prerequisites
103-
104-
- [Bun](https://bun.sh) v1.2.15 or later
105-
106-
### Install Dependencies
10757
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 }}
11668
```
11769

118-
### Type Check
70+
### 2. Auto Code Review on PRs
11971

120-
```bash
121-
bun run typecheck
122-
```
72+
Automatically review every new pull request:
12373

124-
### Run Locally
74+
```yaml
75+
on:
76+
pull_request:
77+
types: [opened, synchronize]
12578
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 }}
12888
```
12989

130-
## How It Works
90+
### 3. Triage New Issues
13191

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:
13693

137-
## Example
138-
139-
When you comment on an issue or PR with:
94+
```yaml
95+
on:
96+
issues:
97+
types: [opened]
14098
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 }}
141108
```
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.

action.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ branding:
66
color: 'purple'
77

88
inputs:
9-
github_token:
10-
description: 'GitHub token for API access'
11-
required: true
129
prompt:
1310
description: 'The prompt to send to Auggie agent'
1411
required: true
@@ -50,7 +47,6 @@ runs:
5047
run: bun run ${{ github.action_path }}/src/index.ts
5148
shell: bash
5249
env:
53-
INPUT_GITHUB_TOKEN: ${{ inputs.github_token }}
5450
INPUT_PROMPT: ${{ inputs.prompt }}
5551
INPUT_AUGMENT_API_KEY: ${{ inputs.augment_api_key }}
5652
INPUT_AUGMENT_API_URL: ${{ inputs.augment_api_url }}

src/auggie.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export type RunAuggieOptions = {
1111
apiKey?: string;
1212
apiUrl?: string;
1313
workspaceRoot?: string;
14-
githubToken?: string;
1514
context?: GithubPullRequest;
1615
/** The body of the comment that triggered this action, if triggered by a comment */
1716
commentBody?: string;
@@ -26,7 +25,6 @@ export async function runAuggie(options: RunAuggieOptions): Promise<string> {
2625
apiKey,
2726
apiUrl,
2827
workspaceRoot,
29-
githubToken,
3028
context,
3129
commentBody,
3230
} = options;
@@ -39,10 +37,11 @@ export async function runAuggie(options: RunAuggieOptions): Promise<string> {
3937
let client: Auggie | null = null;
4038

4139
try {
42-
// Set GITHUB_API_TOKEN environment variable if provided
40+
// Set GITHUB_API_TOKEN environment variable from GITHUB_TOKEN if available
41+
const githubToken = process.env.GITHUB_TOKEN;
4342
if (githubToken) {
4443
process.env.GITHUB_API_TOKEN = githubToken;
45-
core.info("✅ GITHUB_API_TOKEN environment variable set");
44+
core.info("✅ GITHUB_API_TOKEN environment variable set from GITHUB_TOKEN");
4645
}
4746

4847
// Create Auggie client

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
*/
1414
async function main(): Promise<void> {
1515
const {
16-
githubToken,
1716
eventName,
1817
prompt,
1918
augmentApiKey,
@@ -22,6 +21,7 @@ async function main(): Promise<void> {
2221
commentBody,
2322
} = getAuggieParams();
2423
const { owner, repo } = parseRepository();
24+
const githubToken = process.env.GITHUB_TOKEN;
2525
const octokit = new Octokit({ auth: githubToken });
2626

2727

@@ -33,7 +33,6 @@ async function main(): Promise<void> {
3333
apiKey: augmentApiKey,
3434
apiUrl: augmentApiUrl,
3535
workspaceRoot: workspaceRoot || undefined,
36-
githubToken,
3736
commentBody,
3837
});
3938

src/utils/index.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ describe("getInput", () => {
1515
});
1616

1717
test("should get input from environment variable", () => {
18-
process.env.INPUT_GITHUB_TOKEN = "test-token";
19-
expect(getInput("github_token")).toBe("test-token");
18+
process.env.INPUT_TEST_TOKEN = "test-token";
19+
expect(getInput("test_token")).toBe("test-token");
2020
});
2121

2222
test("should convert input name to uppercase with underscores", () => {

src/utils/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,6 @@ export async function reactToComment({
163163
}
164164

165165
type AuggieParams = {
166-
githubToken: string;
167166
eventName: string;
168167
prompt: string;
169168
augmentApiKey: string;
@@ -184,15 +183,13 @@ export function getEventName(): string {
184183
}
185184

186185
export function getAuggieParams(): AuggieParams {
187-
const githubToken = getInput("github_token", true);
188186
const eventName = getEventName();
189187
const prompt = getInput("prompt", true);
190188
const augmentApiKey = getInput("augment_api_key", true);
191189
const augmentApiUrl = getInput("augment_api_url", true);
192190
const workspaceRoot = getInput("workspace_root");
193191
const commentBody = getCommentBodyFromEvent();
194192
return {
195-
githubToken,
196193
eventName,
197194
prompt,
198195
augmentApiKey,

0 commit comments

Comments
 (0)