|
1 | | -# augment-action |
| 1 | +# Augment Action |
2 | 2 |
|
3 | | -To install dependencies: |
| 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 |
| 11 | + |
| 12 | +## Usage |
| 13 | + |
| 14 | +### Basic Setup |
| 15 | + |
| 16 | +Create a workflow file in your repository at `.github/workflows/auggie-bot.yml`: |
| 17 | + |
| 18 | +```yaml |
| 19 | +name: Auggie Bot |
| 20 | + |
| 21 | +on: |
| 22 | + issue_comment: |
| 23 | + types: [created] |
| 24 | + pull_request_review_comment: |
| 25 | + types: [created] |
| 26 | + |
| 27 | +jobs: |
| 28 | + react-to-comment: |
| 29 | + runs-on: ubuntu-latest |
| 30 | + if: contains(github.event.comment.body, '@auggiebot') |
| 31 | + |
| 32 | + steps: |
| 33 | + - name: Checkout augment-action |
| 34 | + uses: actions/checkout@v4 |
| 35 | + with: |
| 36 | + repository: augmentcode/augment-action |
| 37 | + path: augment-action |
| 38 | + |
| 39 | + - name: React with eyes emoji |
| 40 | + uses: ./augment-action |
| 41 | + with: |
| 42 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 43 | + comment_id: ${{ github.event.comment.id }} |
| 44 | + event_name: ${{ github.event_name }} |
| 45 | +``` |
| 46 | +
|
| 47 | +### Inputs |
| 48 | +
|
| 49 | +| Input | Description | Required | |
| 50 | +|-------|-------------|----------| |
| 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 |
| 56 | + |
| 57 | +| Output | Description | |
| 58 | +|--------|-------------| |
| 59 | +| `success` | Whether the reaction was successfully added (`true` or `false`) | |
| 60 | + |
| 61 | +### Customization |
| 62 | + |
| 63 | +#### Trigger on Different Keywords |
| 64 | + |
| 65 | +Change the `if` condition to trigger on different text: |
| 66 | + |
| 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: |
| 74 | + |
| 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 | +```yaml |
| 88 | +on: |
| 89 | + issue_comment: |
| 90 | + types: [created] |
| 91 | +``` |
| 92 | + |
| 93 | +For PR review comments only: |
| 94 | +```yaml |
| 95 | +on: |
| 96 | + pull_request_review_comment: |
| 97 | + types: [created] |
| 98 | +``` |
| 99 | + |
| 100 | +## Development |
| 101 | + |
| 102 | +### Prerequisites |
| 103 | + |
| 104 | +- [Bun](https://bun.sh) v1.2.15 or later |
| 105 | + |
| 106 | +### Install Dependencies |
4 | 107 |
|
5 | 108 | ```bash |
6 | 109 | bun install |
7 | 110 | ``` |
8 | 111 |
|
9 | | -To run: |
| 112 | +### Run Tests |
| 113 | + |
| 114 | +```bash |
| 115 | +bun test |
| 116 | +``` |
| 117 | + |
| 118 | +### Type Check |
| 119 | + |
| 120 | +```bash |
| 121 | +bun run typecheck |
| 122 | +``` |
| 123 | + |
| 124 | +### Run Locally |
10 | 125 |
|
11 | 126 | ```bash |
12 | 127 | bun run index.ts |
13 | 128 | ``` |
14 | 129 |
|
15 | | -This project was created using `bun init` in bun v1.2.15. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime. |
| 130 | +## How It Works |
| 131 | + |
| 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 |
| 136 | + |
| 137 | +## Example |
| 138 | + |
| 139 | +When you comment on an issue or PR with: |
| 140 | + |
| 141 | +``` |
| 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