|
| 1 | +# Comment Reaction Action - Integration Guide |
| 2 | + |
| 3 | +## Summary |
| 4 | + |
| 5 | +A new GitHub Action has been created in the `augment-agent` repository that can react to user comments with emoji reactions. This action is designed to be used in workflows that respond to PR review comments and issue comments. |
| 6 | + |
| 7 | +## Repository Information |
| 8 | + |
| 9 | +- **Repository**: `augmentcode/augment-agent` |
| 10 | +- **Branch**: `feature/comment-reaction-action` |
| 11 | +- **Action Path**: `comment-reaction/` |
| 12 | +- **Commit**: `826fcce` |
| 13 | + |
| 14 | +## What Was Created |
| 15 | + |
| 16 | +### Files Created |
| 17 | + |
| 18 | +1. **comment-reaction/action.yml** - Action metadata and composite action definition |
| 19 | +2. **comment-reaction/src/index.ts** - TypeScript implementation |
| 20 | +3. **comment-reaction/package.json** - Node.js dependencies |
| 21 | +4. **comment-reaction/tsconfig.json** - TypeScript configuration |
| 22 | +5. **comment-reaction/README.md** - Documentation and usage examples |
| 23 | +6. **comment-reaction/package-lock.json** - Dependency lock file |
| 24 | + |
| 25 | +### Key Features |
| 26 | + |
| 27 | +- ✅ React to PR review comments |
| 28 | +- ✅ React to issue comments |
| 29 | +- ✅ Support for all 8 GitHub reaction types (+1, -1, laugh, confused, heart, hooray, rocket, eyes) |
| 30 | +- ✅ Configurable reaction type with sensible default (eyes) |
| 31 | +- ✅ Full TypeScript implementation with type safety |
| 32 | +- ✅ Comprehensive error handling and logging |
| 33 | +- ✅ Output indicating success/failure |
| 34 | + |
| 35 | +## How to Reference in assistant.yml |
| 36 | + |
| 37 | +### Option 1: Reference the Branch Directly |
| 38 | + |
| 39 | +```yaml |
| 40 | +- name: React to original comment with eyes |
| 41 | + uses: augmentcode/augment-agent/comment-reaction@feature/comment-reaction-action |
| 42 | + with: |
| 43 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 44 | + comment_id: ${{ github.event.comment.id }} |
| 45 | + event_name: ${{ github.event_name }} |
| 46 | +``` |
| 47 | +
|
| 48 | +### Option 2: With Custom Reaction |
| 49 | +
|
| 50 | +```yaml |
| 51 | +- name: React to original comment with rocket |
| 52 | + uses: augmentcode/augment-agent/comment-reaction@feature/comment-reaction-action |
| 53 | + with: |
| 54 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 55 | + comment_id: ${{ github.event.comment.id }} |
| 56 | + event_name: ${{ github.event_name }} |
| 57 | + reaction: rocket |
| 58 | +``` |
| 59 | +
|
| 60 | +### Complete Example for assistant.yml |
| 61 | +
|
| 62 | +Replace the existing `actions/github-script@v7` step (lines 31-53) with: |
| 63 | + |
| 64 | +```yaml |
| 65 | +- name: React to original comment with eyes |
| 66 | + uses: augmentcode/augment-agent/comment-reaction@feature/comment-reaction-action |
| 67 | + with: |
| 68 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 69 | + comment_id: ${{ github.event.comment.id }} |
| 70 | + event_name: ${{ github.event_name }} |
| 71 | + reaction: eyes |
| 72 | +``` |
| 73 | + |
| 74 | +## Inputs |
| 75 | + |
| 76 | +| Input | Description | Required | Default | |
| 77 | +|-------|-------------|----------|---------| |
| 78 | +| `github_token` | GitHub token for API access | Yes | - | |
| 79 | +| `comment_id` | The ID of the comment to react to | Yes | - | |
| 80 | +| `event_name` | The GitHub event name | Yes | - | |
| 81 | +| `reaction` | The reaction type to add | No | `eyes` | |
| 82 | + |
| 83 | +## Outputs |
| 84 | + |
| 85 | +| Output | Description | |
| 86 | +|--------|-------------| |
| 87 | +| `success` | Whether the reaction was successfully added (`true` or `false`) | |
| 88 | + |
| 89 | +## Supported Reactions |
| 90 | + |
| 91 | +- `+1` - 👍 |
| 92 | +- `-1` - 👎 |
| 93 | +- `laugh` - 😄 |
| 94 | +- `confused` - 😕 |
| 95 | +- `heart` - ❤️ |
| 96 | +- `hooray` - 🎉 |
| 97 | +- `rocket` - 🚀 |
| 98 | +- `eyes` - 👀 |
| 99 | + |
| 100 | +## Next Steps |
| 101 | + |
| 102 | +1. **Test the Action**: You can now reference this action in the `bumpy/.github/workflows/assistant.yml` file |
| 103 | +2. **Merge to Main**: Once tested, merge the `feature/comment-reaction-action` branch to `main` |
| 104 | +3. **Create a Tag**: After merging, create a version tag (e.g., `v1.0.0`) for stable references |
| 105 | +4. **Update References**: Update workflow files to use the tag instead of the branch name |
| 106 | + |
| 107 | +## Example: Full Workflow Integration |
| 108 | + |
| 109 | +```yaml |
| 110 | +name: Augment Agent |
| 111 | +
|
| 112 | +on: |
| 113 | + pull_request_review_comment: |
| 114 | + types: [created] |
| 115 | + issue_comment: |
| 116 | + types: [created] |
| 117 | +
|
| 118 | +permissions: |
| 119 | + contents: read |
| 120 | + pull-requests: write |
| 121 | + issues: write |
| 122 | + id-token: write |
| 123 | + actions: read |
| 124 | +
|
| 125 | +jobs: |
| 126 | + auggie-review-comment: |
| 127 | + if: | |
| 128 | + contains(github.event.comment.body, '@augment') || |
| 129 | + contains(github.event.comment.body, '@Augment') |
| 130 | + runs-on: ubuntu-latest |
| 131 | + steps: |
| 132 | + - name: Checkout code |
| 133 | + uses: actions/checkout@v4 |
| 134 | + with: |
| 135 | + repository: ${{ github.repository }} |
| 136 | + token: ${{ secrets.GITHUB_TOKEN }} |
| 137 | + ref: ${{ github.event.pull_request.head.ref }} |
| 138 | + |
| 139 | + - name: React to original comment with eyes |
| 140 | + uses: augmentcode/augment-agent/comment-reaction@feature/comment-reaction-action |
| 141 | + with: |
| 142 | + github_token: ${{ secrets.GITHUB_TOKEN }} |
| 143 | + comment_id: ${{ github.event.comment.id }} |
| 144 | + event_name: ${{ github.event_name }} |
| 145 | + reaction: eyes |
| 146 | + |
| 147 | + # ... rest of your workflow steps |
| 148 | +``` |
| 149 | + |
| 150 | +## Support |
| 151 | + |
| 152 | +For issues or questions, please refer to the README.md in the comment-reaction directory or create an issue in the augment-agent repository. |
| 153 | + |
0 commit comments